Notifications
Announcements
I have read this solution here:
https://powerusers.microsoft.com/t5/Building-Flows/Get-name-of-environment-that-flow-is-running-in/m-p/725802#M99224
DeepakS has provided a solution, but I cannot fathom what it means.
What is workflow() and how do I use it?
I do not see any information I can use at the link: https://docs.microsoft.com/en-us/connectors/powerplatformforadmins/#get-environment-as-admin
Can anyone provide me with more details?
Hi @stapes ,
I think that your question should be posted on PowerAutomate community.
But, here is your answer:
workflow() is a function in PowerAutomate, you should use it inside the Get Environment as Admin action. On Get Environment as Admin action environment please use Enter a custom value and then use the following formula to get your result:
See the picture:
That's great @gabibalaban
How can I get that data back to my app? I usually use a Request / Response in the Flow & a ClearCollect in the App.
Yes ... Use from PowerApps ->Action -> PowerAutomate and create a flow triggered by PowerApps.
Use as last action in PowerAutomate the action Respond to PowerApps ( and set the data you need that PowerAutomate to respond to PowerApps).
@gabibalaban
I can't seem to make that work.
All I am getting back in my App is a Boolean 'True' value:
Set(gblEnvironmentVariable,'PowerApp->GetEnvironmentasAdmin'.Run());
You mean that when you use
gblEnvironmentVariable.DisplayName
you didn't get the desired result ?
If no, please go to PowerAutomate and check the succesfullines of the flow.
I think my flow is working, but no data is being returned to my app!
To check the issue please set :
Set(gblEnvironmentVariable,'PowerApp->GetEnvironmentasAdmin'.Run().displayname);
this it should set gblEnvironmentVariable only with the displayname received from PowerAutomate.
Is there any possibility to set/use gblEnvironmentVariable in other place of the app ?
It does not allow Set(gblEnvironmentName,'PowerApp->GetEnvironmentasAdmin'.Run().DisplayName)
I get Invalid use of '.'
It seems that is a problem I cannot identify. Please find attach a demoapp which include all your request. It worked fine on my side.
Thanks @gabibalaban - that definitely works.
What does it use Outlook for? It asked for permission to use Outlook.
Like you, I can see no reason why yours works & mine doesn't.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 796 Most Valuable Professional
Michael E. Gernaey 327 Super User 2025 Season 2
Power Platform 1919 268