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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Get current App ID wit...
Power Apps
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

    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
    @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
    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
    40 on at
     
    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,890 on at
    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
  • VGKolar Profile Picture
    33 on at
    This is a clever workaround, I can Say
    Since Canvas apps cannot read the App ID at runtime, using a Power Automate flow to return an environment variable value is a practical solution. The environment variable stores the app ID per environment, and the flow simply passes it back to the app, keeping the app non-premium. This approach works well and fits ALM scenarios, although it's still an indirect method because Canvas apps don’t natively expose metadata like App ID.

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

Forum hierarchy changes are complete!

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard