One of the coolest features of Microsoft’s Flow is the ability of export and import a flow as a template. You can easily share complete and complex flows in a file with anyone.
In the following sections, I’ll explain how to create a template, the contents of the exported file, and how to import it.
Creating a Template
Just choose the flow you want to export and click the Export dropdown:
You can get it also from the Flow’s details page:
There are two ways to export the flow:
- Package (.zip)
- Logic Apps Template (.json)
We’ll focus on the package option. I’ll explore the Logic Apps Template in future articles.
Pick the Package option:
There a few things to take in consideration:
- You can name the flow anything. The user can choose the name in the import process.
- Remove the Environment. If the users are within the same company, this may not be an issue since they share the same environment, but if they don’t then the default value will be an environment that doesn’t exist for that user. If the value is missing, the import process will import the flow to your default environment.
- Import Setup. You have the option to say that you want to import the package as an update to an existing flow or as a new one. You can change these options in the import process, but I recommend using the New, even if the Update is the default option.
Importing as new will have several advantages:
- The user may override a current flow with the same name by accident.
- If the user wants to override a flow, he/she needs to select it explicitly.
- New is (in my opinion) the most frequent option and should be the default one.
Just click Export, and you’ll get a sharable .zip file.
The file is relatively technical so that I won’t go into much detail about its content. You’ll only need to open it in rare cases like this one, but here is a high-level description of the contents of the file.
Here are the packaged objects:
- Flow’s steps – The export process will wrap all steps and connections contained in the package.
- Connections – The export process will package the connections’ necessary information without the credentials or locations.
- Flow’s metadata – The information that you filled-in above
- PowerApps – Any created PowerApp.
The process won’t package:
- Custom connectors. You need to re-create them manually before importing the new flow.
- Connections. The export process won’t include in the package any connections that need credentials. It will keep only the necessary information so that you can re-map it in the import process.
- Roles and Permission. The export process won’t include any roles or permissions in the package. The user will create them manually after they import the package.
Importing a template
To import a template is even simpler. Just select Import in the main screen and select the .zip file.
The import process will now upload the file and parse it. You’ll be able to check the details of the import process in the following screen.
The import process will fill in the fields based on the package’s data, but you can rename any of them as needed.
You will also need to map the exported connections. The import process will help you in this by flagging the missing ones on a screen like this:
A new screen will display the existing or provide you the possibility to create a new one:
To finalize just press Import. The new Flow will appear in your flow list.
- Currently, you cannot re-map connectors. For instance, if you’re using a SharePoint list connection, you cannot change it to a SQL Server table.
- The export utility can’t, for now, export any custom connectors. If you want to re-use them, you need to create them again.
- You need to re-add any roles to the new flow. The export utility won’t include then in the package file.
- Export and import your flows across environments with packaging
- Our list of templates (updated frequently)