Improve flow portability with environment variables
A flow design includes logic that determines which actions to take. Also, the design logic might include references to configuration data that refers to the environment that this flow runs in.
With environment variables, you can position this configuration data outside the flow. As a result, you can deploy the flow across different environments without the need to modify it, and it respects the ALM guidelines that are in place.
Define environment variables
To create a new environment variable, follow these steps:
In the target solution where you want to add this variable, select New > More > Environment variable.
Provide a Display name and then edit the generated name based on the naming conventions that might apply to your organization.
Document the variable purpose in the Description field.
Select the appropriate data type:
- Decimal - Numeric value
- JSON - Structured information
- Text - Unstructured information
- Yes/No - Boolean value
- Data source - SharePoint, Microsoft SQL Server, Dataverse, or SAP ERP
- Secret - Microsoft Azure Key Vault secrets
When applicable, define a default value to use if no current value is defined.
You can set Current Value at design time or later.
Include environment variables in a cloud flow
You can reference environment variables in cloud flow triggers and actions by selecting them in the Parameters section of the Dynamic content option for custom values.
Update environment variables in other environments
Whether you manually create an environment variable or use an automated process with Microsoft Power Platform pipelines, if an environment variable doesn’t have a default or current value during solution import, the system prompts for one. Also, you can update an environment variable’s current value in the solution.
Next steps
Now you've learned how to improve cloud flow portability with environment variables. Next, you learn how to manage flow versions.