There have been several posts on the environment variables, but I think Microsoft just released a pretty GREAT update recently. I honestly don’t have a clue when this function was released, but it made my day a LOT easier:) This is how we used to refer to Environmental Variables:
Basics
When moving solutions from system A to system B we often have hardcoded values in workflows/flows/javascripts etc. These cause problems because the fields often have different values in each environment.
![](http://crmkeeper.files.wordpress.com/2021/05/image-9.png?w=374)
Sure you can migrate variables/records between systems and be sure to never overwrite, but it can be time consuming to maintain.
Microsoft has introduced environmental variables to Dynamics / Dataverse to fix this exact problem. You create a new Environmental variable in your solution, and you can se the value for each environment. Within CRM you can refer to the environmental variable instead of hardcoded values:)
![](http://crmkeeper.files.wordpress.com/2021/05/image-6.png?w=345)
Within the solution explorer you can add Environmental variables that can be used across the different systems. In this test I am using a variable to define what environment I am working in “Test or Production”.
I wont be writing about the Environment variables in detail, as you can read more about them in other posts, but I wanted to cover the new way of using this within Power Automate!
Accessing the Environmental Variables in Power Automate Flow
Start by creating a new Power Automate, and add compose function
![](http://crmkeeper.files.wordpress.com/2021/05/image-7.png?w=1024)
Check out that bad boy! No longer need for get record calls from entities etc. A nice improvement that will save a few minutes here and there.