Power Automate – Data sources using Environment Variables

In this blog , I will describe how to use environment variables to pass data sources in power automate flows.

Environment variables help us in a great way to reduce the manual association of data sources in each environment.

  • Login to https://make.powerapps.com
  • Navigate to Solutions -> Add New->More->Environment variables
  • Create an environment variable for Site .
  • Choose the Data Type – Data Source
  • Associate SharePoint connector if you have already created. Else create a connection and associate it here.
  • Choose the parameter type as ‘Site’.
  • Associate the SharePoint Site . You can pass the Default site value and a current value ( which is unique for each environment).
  • If the current value is not specified , default value will be used.
  • Once the environment variable for site is created, we need to create one more environment variable for List.
  • Follow the same steps as above and create a new environment variable,
  • Choose the Parameter Type as ‘List’.
  • Under Site , Specify the name of Environment variable we created in above step.
  • Now login to https://flows.microsoft.com
  • choose the flow that is using sharepoint list as data source or create a new flow,
  • In the Site Address – instead of specifying the URL directly choose ‘custom value’
  • Now you will observe that the environment variables are available to use in ‘Dynamic Content’
  • Use the Environment variables created for Site and List respectively,
  • This helps is deploying the Canvas Apps from one environment without manual intervention in Data source connections.