Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Get Current Environment

(0) ShareShare
ReportReport
Posted on by 65

Within either a Cloud Flow or a Desktop Flow, is there a way to get the current runtime environment that the flow is being run in? 

 

Use case...I have variables that need to be set based on environment and I would like to not have to alter the flow after deploying to a new environment.

  • BI_RPA_Andy Profile Picture
    BI_RPA_Andy 65 on at
    Re: Get Current Environment

    Am I able to access the environment variable from a desktop flow?

  • Ripoll22 Profile Picture
    Ripoll22 3 on at
    Re: Get Current Environment

    Although the previous reply works, I would rather go for environment variables, since they provide the exact functionality that you are looking for:

    https://learn.microsoft.com/en-us/power-apps/maker/data-platform/environmentvariables

  • VJR Profile Picture
    VJR 7,635 on at
    Re: Get Current Environment

    Hi @BI_RPA_Andy 

     

    In Power Automate Desktop you can make use of the Windows environment variable explained in detail here.

    Using Windows Environment Variables in Power Automate Desktop 

     

  • BI_RPA_Andy Profile Picture
    BI_RPA_Andy 65 on at
    Re: Get Current Environment

    Your answer seems to assume a level of familiarity with the platform that I do not possess.  I will try to decipher what you mean and work through it.

     

    Additionally, is there a way to obtain this information within Power Automate Desktop apart from an input variable?  I would like to be able to set variables dynamically within a desktop flow independent of a triggering flow.

  • rsaikrishna Profile Picture
    rsaikrishna 3,703 on at
    Re: Get Current Environment

    @BI_RPA_Andy 

     

    To get the environment "display name" you should use both workflow() and Get Environment as Admin action.

    Get Environment as Admin required environment ID that you will get from : workflow()['tags']['environmentName']

    Enviroment display name : body('Get_Environment_as_Admin')?['properties']?['displayName']

     

    Please check following reference posts: 

    https://powerusers.microsoft.com/t5/Building-Flows/Get-name-of-environment-that-flow-is-running-in/m-p/725802#M99224 

     

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Get-name-of-environment-that-flow-is-running-in/td-p/725828

     

    Regards

    Krishna Rachakonda

    If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

     

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.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,495

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,822

Leaderboard