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 Solution
    • 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

Reduce number of environment variables in Power Automate flows

Posted on March 31, 2024March 31, 2024 by Tom

“All those environment variables make quite a mess when building a Power Automate flow, how can I reduce their number?”


As already said in a previous article, you should create all your flows in Solutions. Not only will it help you to stay organised, but it’ll be much easier to configure or move the flows too. Each solution can include environment variables, a global configuration that can be referenced in the flow or Power Apps. Reconfiguration of the flow is then done through these variables.

Yet if you create too many solutions with too many environment variables it can turn into a mess. Power Automate doesn’t check whether they’re in the solution or not, it’ll show all of them. The more environment variables, the more searching in the dynamic contents.

Power Automate reduce environment variables

Is there some way to reduce their amount, to not have a separate env. variable for everything?

Create JSON environment variables

As you probably know by now, Power Automate is based on JSON. All actions in the flow use JSON, all data is stored in a JSON. Why not use JSON also to store data in an environment variable?

JSON gives you the possibility to store the configuration in an object. In the same way you create mapping tables in a flow, you can use them also in the variable.

Create a new Text variable and paste the object with configuration in the variable, e.g.

{
  "SPSite": "https://xxx.sharepoint.com/sites/playground",
  "SPList": "956e5e0e-bd9e-4a46-9ca5-586c9ed9556c",
  "ErrorEmail": "no-reply@tomriha.com",
  "RIDPrefix": "REQ"
}
Power Automate reduce environment variables

Use JSON environment variable

When using the variable in a flow, it’ll be taken as a text by default.

But you need it as a JSON to select the specific value – apply the json(…) expression on the variable.

Once converted you can select the desired value from the JSON object, e.g.

json(parameters('envVar_JSON (cr309_envVar_JSON)'))?['SPSite']
Power Automate reduce environment variables

Summary

While environment variables are a great way to configure your solutions, they can make editing of Power Automate flows quite annoying, hence it might be worth to reduce their number. You don’t have to replace all of them with a JSON, especially if you use them in Power Apps too, but sometimes it’s worth considering also this possibility.


πŸš€ Master Power Automate

Join 2,100+ 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,100+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Still exchanging emails to get things approved?

Get the Approval Process solution and the Task Delegation App to skip the hard part and deploy an automated, 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