Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

How to manage environment variables in Power Automate solutions

Posted on December 3, 2023December 7, 2023 by Tom

“I’d love to use Solutions for Power Automate flows, but the environment variables keep changing with each import!”


When you’re building a new flow, it’s a good idea to start from a Solution. Create a solution and add the flow as part of this newly created solution. This way you’ll get a few benefits – you can use connection references instead of fixed connections, and environment variables for the flow configuration. Such flow is then much easier to manage as all you have to change are these references/variables. It can be also transferred between different environments with minimal friction, no need to touch the flow. You just update a few variables and the flow will work as e.g. the approval process template.

There might be a few small issues with the environment variables during the transfer though.

Don’t put environment variables into managed solutions

Update: you can actually update even managed environment variables through the “Default Solution”.

If you’re using managed solutions on the environment, don’t put the environment variables as part of that solution. By design, managed solutions can’t be changed (even though that’s not really true for Power Apps and flows), meaning you can’t change even the environment variables. Once it’s in a managed solution and you make a mistake, you’re done. You won’t be able to change it.

That’s why it’s better to keep the environment variables in a separate, unmanaged solution. You’ll get two benefits from that – you can change the environment variables, that’s the main one. The second is that you don’t have to transfer the environment variables with every solution import. The variables won’t change as often as the app or the flow might.

Power Automate solutions environment variables

Remove the variables from unmanaged solutions once created

Similarly to the managed solutions, you don’t really want to keep the environment variables in the unmanaged solution all the time. While in managed solutions it’s the unchangeability that’s causing problems, in unmanaged solutions it’s the opposite – they sometimes change the values during the import. Instead of keeping the value defined on the environment, they’ll replace it with the original value, making the import more complicated as you might need to check / update the variables again.

To avoid this I keep also environment variables in unmanaged solutions separated:

  1. When you create the initial solution, include also the environment variables.
  2. For the first export/import to the other environment keep the solution as it is with the environment variables.
  3. Once imported for the first time, remove the environment variables from the solution. They already exist on the new environment, no need to import them again. IMPORTANT: Make sure you remove them only from the Solution, not from the whole environment!
  4. Create one extra solution on the environment and add all the environment variables in this solution. You still want to have the possibility of updating the variables some day in the future = they must be in some solution. It can be just a single solution for the whole environment where you aggregate all the environment variables.
  5. If you want to import the whole solution to a different environment, start from step 1 again.

The idea is the same a with the managed solutions – you don’t need to import environment variables over and over again. Once it’s enough. The first import will create them and they’ll stay on the environment, no need for keeping them in the solution all the time.

Summary

Dealing with environment variables can be sometimes confusing which is the reason why many builders don’t even use solutions for their Power Automate flows. But they’re nothing more than variables – you create them on the environment, configure them, and you’re done, nothing else is needed from your side. It’s not necessary to keep them in the solution that you export/import multiple times as they don’t change that often, maybe even not at all. Import them once, maybe even in a separate solution, and use them forever.


πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Working on an Approval process?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy a fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes