Do you use Dev, Test, UAT and Production environments within you Power Platform. Would you like to show your environment name in the app so that you don’t get confused? In this post I’m showing you a quick trick to get the environment name to display in you app.
Workflow function in Power Automate
Table of Contents
I’m going to use Power Automate to get my current environment as part of the flow details. There is the environmentName property there but not the display name of my environment. The environment name however will help us get to the display name of the environment.
{ "id":"/workflows/6aedd5280169431c8e99974485692d00", "name":"2c1925be-3ea2-63d3-91c8-d8add99c1037", "type":"Microsoft.Logic/workflows", "location":"uksouth", "tags":{ "flowDisplayName":"test env", "licenseContextConfigName":"CONTEXT_USER-092E5A703D8940FF8FB0E3D84FF7669D_POWERAUTOMATE_PREMIUM40K", "environmentName":"3a876bf1-c753-ecf1-a227-a9ebba7e3ba9", "logicAppName":"2c1925be-3ea2-63d3-91c8-d8add99c1037", "environmentWorkflowId":"3a876bf1:2Dc753:2Decf1:2Da227:2Da9ebba7e3ba9-648c6a17:2D4f7a:2Dbe33:2D1bde:2D53ffe31a8da0", "xrmWorkflowId":"648c6a17-4f7a-be33-1bde-53ffe31a8da0", "environmentFlowSuspensionReason":"3a876bf1:2Dc753:2Decf1:2Da227:2Da9ebba7e3ba9-None"," sharingType":"CommonDataService", "state":"Enabled", "createdTime":"2/17/2026 12:10:09 PM", "lastModifiedTime":"2/17/2026 12:10:09 PM", "createdBy":"092e5a70-3d89-40ff-8fb0-e3d84ff7669d", "triggerType":"Instant", "createdByUserId":"3985C6A611D84C1384A91847F555AE47-3A876BF1C753ECF1A227A9EBBA7E3BA9-ENV"}, "run":{ "id":"/workflows/6aedd5280169431c8e99974485692d00/runs/08584302766683024932442064446CU05", "name":"08584302766683024932442064446CU05", "type":"Microsoft.Logic/workflows/runs" }} So, how do we get the environment name to display?
First I’m going to create a flow that has a trigger When Power Apps calls a flow (V2) then I’m adding a Get Environment as Admin. This might sound easy, but it is actually difficult to find this action in the Power Automate search. When searching for Environment the action however appears near the top of the search results.

Have you ever had problems finding the right actions?
If in the above example you search for Get Environment…. You will get all connectors with a the word get listed first. For all searches use the action specific words.
Then finally we need a Respond to a Power Apps or flow action to return the Environment name.

Get Environment as Admin
The Get Environment as Admin needs to be configured like this:

Using the expression:
workflow().tags.environmentName That is easy enough.
Then the respond action can take the Display Name from the previous action. Simply select this using Dynamic content.

Now all we need to do is add the flow to Power Apps and display our environment name. In the App.OnStart I set a variable that will then run my flow.

Now simply add a label with the varEnvironment setting the Text property and we’re done.
Discover more from SharePains
Subscribe to get the latest posts sent to your email.