Power Automate provides a set of incredibly robust and powerful tools for business process automation, especially when used in conjunction with Dynamics and the Power Platform as whole. To that end, we can leverage Power Automate to locate an environment’s GUID (globally unique identifier) in the first few steps of a flow run. This gives flow builders the ability to allow certain components of a flow to run in whole or in a modified state based on whether or not the environment is a production or test/QA environment.
Power Automate Flow Steps
In our flow, we can create a Compose Action step and set the inputs to the following expression:
workflow()[‘tags’][‘environmentName’]
This expression will return the full GUID of the environment. Since an environment’s GUID is non-volatile (i.e., it can never be changed), we can utilize this information to determine if the GUID relates to the Production (live) environment or not.