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

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

Get current App ID within the app and across environments

(0) ShareShare
ReportReport
Posted on by 32

Hi Community!

I have an app which lives in two different environments and hence has 2 different App IDs but the same app display name (ALM with Solutions).

Is there a way to get the current App ID directly within a canvas app? I know about the way to add an environment variable to a solution and edit the value within the Azure DevOps pipeline, however you need to add Dataverse tables as datasource to the canvas apps and this is cannot be fulfilled for all apps in my case due to the premium functionality.

 

The reason why I need the app ID is to create and re-use a component to show all Infos about the currently opened app, like Environment id, app id, last published etc.

 

Thanks in advance for your help!

I have the same question (0)
  • Verified answer
    PowerDash Profile Picture
    32 on at
    Re: Get current App ID within the app and across environments

    In case if somebody else is struggling: I managed to get the current app ID with this formula:

    Set(AppID,Last(Split(Param("appId"),"/")).Result);

     

    Can we add this to the MS documentation?

  • ShaileshP Profile Picture
    31 on at
    Get current App ID within the app and across environments
    @PowerDash I dont see the below code works.. Any other recommendations?
     
    Set(AppID,Last(Split(Param("appId"),"/")).Result); 
  • Suggested answer
    DS-11060559-0 Profile Picture
    on at
    Get current App ID within the app and across environments
    I am facing the same issue, and I could not find anything helpful. 
    I found a workaround, which I think would work for you as well. I am not sure this is the best way, but it works :)
     
    I have created an environment variable where I store the app ID, and then I have created a very simple power automate flow that returns that value.
    This way you avoid using Dataverse tables and your app does not become premium :) See the screenshot below:
     
     
    I have then added the following formula on App - OnStart:
    Set(varAppId, 'Nameofyourflow'.Run().appid);
     
    I hope this helps :)
  • HJ-23070237-0 Profile Picture
    36 on at
    Get current App ID within the app and across environments
     
    I'm confused though, once I deploy the app through the pipeline to a managed solution, I can't update the value of the environment variable, but I cant get the new App ID until I deploy the app for the first time. Am I missing something?
  • Power Platform 1919 Profile Picture
    1,773 on at
    Get current App ID within the app and across environments
    You can check this thread, this can help :
     
    In this thread, you can find a way to get current app details without using any variables or manual config.
     
    This is my simple solution for ALM

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

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 803 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 314 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 253 Super User 2025 Season 2

Last 30 days Overall leaderboard