web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / PowerApps environment ...
Power Apps
Answered

PowerApps environment self-awareness

(0) ShareShare
ReportReport
Posted on by 381

Hi
Is there a way that PowerApps can be self-aware of their environment?

We follow the usual dev/test/prod process which works fine until we hold values that are environment sensitive for example the app URL used for embedded links and when referencing the Teams user group (when using PowerApps for Teams).

 

Ideally, we want the app to know what environment it is in so that it can automatically use the correct links etc. If possible, if the app was also able to find it's own URL and/or Team group this would be fantastic.

 

I suspect that this isn't possible, I couldn't find anything on the topic hence this post.

Categories:
  • Verified answer
    BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @Gary_Eden ,

     

    It is possible to get the App ID from inside the app, which will allow you to build a URL:

     

    https://www.youtube.com/watch?v=lJBLfmItlGw

     

    URL: https://apps.powerapps.com/play/ & App ID

  • Gary_Eden Profile Picture
    381 on at

    Thanks @BCBuizer just what I needed - easy when you know how (and looks like there is more to experiment with beyond what I first needed).

     

  • Gary_Eden Profile Picture
    381 on at

    Hi @BCBuizer

    Thanks for your earlier response it helped.

    The solution works perfectly providing that your apps have unique names.  

    The problem is that PowerAppsforMakers.GetApps() isn't local to the environment. So if you use the dev/test/prod process you have three apps with the same name and the method returns the first match with the app name - usually the dev version.

     

    I've read through the MS doc's here which give an idea of what else is possible. However, I can't see how it's possible to restrict PowerAppsforMakers.GetApps() to it's local environment. 

     

    Basically, I want/need to set up the app self awareness so that it is also self aware of the environment it sits in automatically. That way when the apps roll forward to test and prod the IDs and URLs automatically change.

     

    To reconfirm my original post, the app uses deep linking within emails so it's important that the correct URL is used relative to the environment the app sits in.

     

    Thanks in advance.

    Gary    

  • Verified answer
    BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @Gary_Eden ,

     

    An idea for this has been raised and has gathered quite some votes already:  https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Function-to-retrieve-App-ID/idi-p/376495

     

    Please upvote this as well if you'd like to see this implemented.

  • Gary_Eden Profile Picture
    381 on at

    Hi @BCBuizer 

    Shame that this doesn't already exist and I've added my vote (now 100).

     

    Looks like the only way for now is to extract the IDs manually and add them to a variable that I can set OnStart and then comment out the ones I don't need and enable the one for the relevant environment.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard