-->
PowerApps is a service for building and using custom business apps that connect to your data and work across platforms. Microsoft Flow makes it easy to automate workflows and business processes between your favorite apps and services. Both PowerApps and Microsoft Flow come with a variety of built-in connectors to data sources such as Office 365, Dynamics 365, Salesforce, and more. In some cases, app and flow builders also want to connect to data sources and APIs built by their organization.
Click Update, and choose “Create as new” so that a new Flow is created in B. Click Save to exit the screen. Finally click Export to download the.zip package file. Now, go to Environment B. Go to My Flows, and click “Import”, and upload the.zip package. Here, notice the red! Next to the Flow and connectors required.
After you've exported your solution, you can import it into any environment that meets the prerequisites. Follow these steps to import a solution: Sign in to Microsoft Flow, and then select Solutions from the navigation bar. Select Import. Select Browse from the Import Solution page that opens. Find and then select the solution that you want to import. In this article, let us see how to export a Microsoft flow and import as a Logic App in Azure. Let us see by step by step. Assume that we have created a Microsoft Flow. The below is a simple flow. On the top right corner, click on the Settings-Export-Logic Apps Template(.json) 3. Download the JSON file in the disk.
Similarly, developers that want to expose their APIs more broadly within an organization can make their APIs available to app and flow builders. This topic shows you how to export an API built with Azure Functions or Azure App Service. The exported API becomes a custom connector, which is used in PowerApps and Microsoft Flow just like a built-in connector.
Important
The API definition functionality shown in this article is only supported for version 1.x of the Azure Functions runtime and App Services apps. Version 2.x of Functions integrates with API Management to create and maintain OpenAPI definitions. To learn more, see Create an OpenAPI definition for a function with Azure API Management.
Create and export an API definition
Before exporting an API, you must describe the API using an OpenAPI definition (formerly known as a Swagger file). This definition contains information about what operations are available in an API and how the request and response data for the API should be structured. PowerApps and Microsoft Flow can create custom connectors for any OpenAPI 2.0 definition. Azure Functions and Azure App Service have built-in support for creating, hosting, and managing OpenAPI definitions. For more information, see Host a RESTful API with CORS in Azure App Service.
Note
You can also build custom connectors in the PowerApps and Microsoft Flow UI, without using an OpenAPI definition. For more information, see Register and use a custom connector (PowerApps) and Register and use a custom connector (Microsoft Flow).
To export the API definition, follow these steps:
In the Azure portal, navigate to your Azure Functions or another App Service application.
If using Azure Functions, select your function app, choose Platform features, and then API definition.
If using Azure App Service, select API definition from the settings list.
The Export to PowerApps + Microsoft Flow button should be available (if not, you must first create an OpenAPI definition). Click this button to begin the export process.
Select the Export Mode:
Express lets you create the custom connector from within the Azure portal. It requires that you are signed into PowerApps or Microsoft Flow and have permission to create connectors in the target environment. This is the recommended approach if these two requirements can be met. If using this mode, follow the Use express export instructions below.
Manual lets you export the API definition, which you then import using the PowerApps or Microsoft Flow portals. This is the recommended approach if the Azure user and the user with permission to create connectors are different people or if the connector needs to be created in another Azure tenant. If using this mode, follow the Use manual export instructions below.
Note
The custom connector uses a copy of the API definition, so PowerApps and Microsoft Flow will not immediately know if you make changes to the application and its API definition. If you do make changes, repeat the export steps for the new version.
Use express export
To complete the export in Express mode, follow these steps:
Make sure you're signed in to the PowerApps or Microsoft Flow tenant to which you want to export.
Use the settings as specified in the table.
Setting Description Environment Select the environment that the custom connector should be saved to. For more information, see Environments overview. Custom API Name Enter a name, which PowerApps and Microsoft Flow builders will see in their connector list. Prepare security configuration If required, provide the security configuration details needed to grant users access to your API. This example shows an API key. For more information, see Specify authentication type below. Click OK. The custom connector is now built and added to the environment you specified.
Use manual export
To complete the export in Manual mode, follow these steps:
Export Microsoft Flow To Visio
Click Download and save the file, or click the copy button and save the URL. You will use the download file or the URL during import.
If your API definition includes any security definitions, these are called out in step #2. During import, PowerApps and Microsoft Flow detects these and prompts for security information. Gather the credentials related to each definition for use in the next section. For more information, see Specify authentication type below.
This example shows the API key security definition that was included in the OpenAPI definition.
Now that you've exported the API definition, you import it to create a custom connector in PowerApps and Microsoft Flow. Custom connectors are shared between the two services, so you only need to import the definition once.
To import the API definition into PowerApps and Microsoft Flow, follow these steps:
Go to powerapps.com or flow.microsoft.com.
In the upper right corner, click the gear icon, then click Custom connectors.
Click Create custom connector, then click Import an OpenAPI definition.
Enter a name for the custom connector, then navigate to the OpenAPI definition that you exported, and click Continue.
On the General tab, review the information that comes from the OpenAPI definition.
On the Security tab, if you are prompted to provide authentication details, enter the values appropriate for the authentication type. Click Continue.
This example shows the required fields for API key authentication. The fields differ depending on the authentication type.
On the Definitions tab, all the operations defined in your OpenAPI file are auto-populated. If all your required operations are defined, you can go to the next step. If not, you can add and modify operations here.
This example has one operation, named
CalculateCosts
. The metadata, like Description, all comes from the OpenAPI file.Click Create connector at the top of the page.
You can now connect to the custom connector in PowerApps and Microsoft Flow. For more information on creating connectors in the PowerApps and Microsoft Flow portals, see Register your custom connector (PowerApps) and Register your custom connector (Microsoft Flow).
Specify authentication type
PowerApps and Microsoft Flow support a collection of identity providers that provide authentication for custom connectors. If your API requires authentication, ensure that it is captured as a security definition in your OpenAPI document, like the following example:
During export, you provide configuration values that allow PowerApps and Microsoft Flow to authenticate users.
This section covers the authentication types that are supported in Express mode: API key, Azure Active Directory, and Generic OAuth 2.0. PowerApps and Microsoft Flow also support Basic Authentication, and OAuth 2.0 for specific services like Dropbox, Facebook, and SalesForce.
API key
When using an API key, the users of your connector are prompted to provide the key when they create a connection. You specify an API key name to help them understand which key is needed. In the earlier example, we use the name API Key (contact meganb@contoso.com)
so people know where to get information about the API key. For Azure Functions, the key is typically one of the host keys, covering several functions within the function app.
Azure Active Directory (Azure AD)
When using Azure AD, you need two Azure AD application registrations: one for the API itself, and one for the custom connector:
To configure registration for the API, use the App Service Authentication/Authorization feature.
To configure registration for the connector, follow the steps in Adding an Azure AD application. The registration must have delegated access to your API and a reply URL of
https://msmanaged-na.consent.azure-apim.net/redirect
.
For more information, see the Azure AD registration examples for PowerApps and Microsoft Flow. These examples use Azure Resource Manager as the API; substitute your API if you follow the steps.
The following configuration values are required:
- Client ID - the client ID of your connector Azure AD registration
- Client secret - the client secret of your connector Azure AD registration
- Login URL - the base URL for Azure AD. In Azure, this is typically
https://login.windows.net
. - Tenant ID - the ID of the tenant to be used for the login. This should be 'common' or the ID of the tenant in which the connector is created.
- Resource URL - the resource URL of the Azure AD registration for your API
Microsoft Flow Export To Excel
Important
If someone else will import the API definition into PowerApps and Microsoft Flow as part of the manual flow, you must provide them with the client ID and client secret of the connector registration, as well as the resource URL of your API. Make sure that these secrets are managed securely. Do not share the security credentials of the API itself.
Generic OAuth 2.0
When using generic OAuth 2.0, you can integrate with any OAuth 2.0 provider. This allows you to work with custom providers that are not natively supported.
The following configuration values are required:
Microsoft Forms
- Client ID - the OAuth 2.0 client ID
- Client secret - the OAuth 2.0 client secret
- Authorization URL - the OAuth 2.0 authorization URL
- Token URL - the OAuth 2.0 token URL
- Refresh URL - the OAuth 2.0 refresh URL
Exporting a Visio diagram to Microsoft Flow is only available on the Visio desktop app in English with Visio Online Plan 2. The feature is available on Office Insiders or the Monthly Channel (Targeted) with Build 11231 and later. You must also have a free or premium plan with Microsoft Flow or a qualifying Office 365 subscription that includes Microsoft Flow. |
Visio and Microsoft Flow now work together to help you get things done faster and simpler. Create a BPMN diagram in Visio and export to Microsoft Flow to automate workflows between your favorite apps and services. For example, you can create a workflow to get notifications when someone submits a form on your website, or collect and organize data for you when someone follows you on Twitter.
Notes:
Microsoft Flow Free
Not sure what version of Visio you're using? Select File > Account > About Visio to see what plan you have.
If you're an Office 365 subscriber, make sure you have the latest version of Office. If you're an IT professional managing the Office 365 update process, check out the channel releases page to learn which updates are provided in each channel.
Design the workflow for Microsoft Flow
Open the Visio desktop app and do either of the following:
Select a BPMN diagram that fits your needs by going to New > Templates > Flowchart. Under the Flowchart category, select Basic Flow Diagram and choose the template you want to work with.
Create a blank drawing and add the BPMN stencil by selecting More Shapes > Flowchart > BPMN Basic Shapes.
Modify or design the diagram of your Microsoft Flow workflow using the BPMN basic shapes.
Here is an example of a Visio diagram of a workflow:
Prepare to export
When you're done designing your workflow, select the Process tab and select Export in the Microsoft Flow group. The Prepare to Export pane will open and display the Flow Mappings tab.
Select the trigger. This is the event that starts your workflow. For example, a purchase request was created.
Under the Map conditions, select either If yes or If no for each gateway connector to create the logic for your workflow. For example, after the request was created, check if it has all the information completed.
Map the shapes to their connectors in Microsoft Flow. To do this, follow the steps below for each shape in your diagram:
Select a BPMN shape in your diagram. This opens the Triggers and Actions tab of the Prepare to Export pane.
Search for and select the trigger or action appropriate for that shape. For example, once the budget is approved, set the status as Accepted.
Once a trigger or action has been applied, you'll see the icon of the connector above the shape.
Select the Refresh button. Under Resolve issues, check to see if you have any issues that need to be addressed in order to export. Continue to fix any issues and Refresh the pane as needed until there are no more issues.
Export your BPMN diagram to Microsoft Flow
Microsoft Powerapps
After all issues have been resolved and you're ready to export, select Export to Flow at the top of the Prepare to Export pane.
In the dialog box, you can rename your flow as needed. You may also be required to sign in to different services depending on what triggers and actions are in your workflow.
Select Create flow to export your diagram to Microsoft Flow. After the flow is created, select Done to close the dialog. To edit the workflow you've created, you can do so from the Microsoft Flow site.