Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

How to get flow environment id from dynamics crm?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Use case : Open flow URL from dynamics crm 365 context.

 

Issue: How to get environment id of the flow url (Eg. https://us.flow.microsoft.com/manage/environments/2f833504-48e4-405a-bf8e-b5536b9e8527/flows) from dynamics 365.

 

Thank You

 

  • Community Power Platform Member Profile Picture
    on at
    Re: How to get flow environment id from dynamics crm?

    Thanks for the help anyway. Back to the drawing board I guess.

     

    I really appreciate your help anyway.

  • Betim Beja Profile Picture
    56 on at
    Re: How to get flow environment id from dynamics crm?

    Hello,

    after some more digging, I figured out that this value gets written to the local storage after you click the flow button in the ribbon 

    Flow Ribbon.png

    yes, the fastest way to test this is to execute the script in the console. You could peek the local storage using the Application tab in the DevTools too.

     

    Best regards,

    Betim Beja.

  • Community Power Platform Member Profile Picture
    on at
    Re: How to get flow environment id from dynamics crm?

    Hi,

     

    This returns a null value for me. In which context do you execute this function?

     

    I tried to simply run it from the console by the way.

  • Betim Beja Profile Picture
    56 on at
    Re: How to get flow environment id from dynamics crm?

    Hello @Anonymous ,

    I found a solution to this but I don't think it is supported.

    You can get the Environment Id in Microsoft Dynamics using the following code

    localStorage.getItem("flowEnvironmentId")

    Best regards,

    Betim Beja. 

  • Community Power Platform Member Profile Picture
    on at
    Re: How to get flow environment id from dynamics crm?

    Hi,

     

    Did you find out how to do this by any chance?

  • sandeepnmenon Profile Picture
    Microsoft Employee on at
    Re: How to get flow environment id from dynamics crm?

    Hi @v-bacao-msft

     

    I need the environment Id programmatically in dynamics crm (Eg. solutiuon, custom control, plugin etc.), not in the flow edit experience. 

     

  • v-bacao-msft Profile Picture
    on at
    Re: How to get flow environment id from dynamics crm?

    Hi @sandeepnmenon,

     

    You could use WDL function to get the environment id contained in flow url.

    Like:

    32.PNG

    Expression:

    last(take(split(outputs('Compose'),'/'),6))

     

    Best Regards,

    Barry

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow