cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pNabin
Advocate V
Advocate V

Getting current apps GUID ID within the app

Is it possible to get current PowerApps application GUID/ID within the PowerApps?

I need to send the email with the link to this app, and static value works but when migrating into another environment, we need to change manually in multiple places. So, getting the app id dynamically would be perfect.

 

Thanks,

Nabin

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@pNabin 

Yes.  The way I go about it, you need the PowerAppsforAdmins connector to do it.  

Then, to test, throw in a label and set the Text property to:

LookUp(PowerAppsforAdmins.GetAdminApps(
     LookUp(PowerplatformforAdmins.GetAdminEnvironment().value, properties.creationType="DefaultTenant").name
     ).value, properties.displayName="yourAppName").name

This, of course, assumes the DefaultTenant environment, but you can adjust as needed.

End result in your test label...the GUID of the app you are looking for.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

6 REPLIES 6
RandyHayes
Super User III
Super User III

@pNabin 

Yes.  The way I go about it, you need the PowerAppsforAdmins connector to do it.  

Then, to test, throw in a label and set the Text property to:

LookUp(PowerAppsforAdmins.GetAdminApps(
     LookUp(PowerplatformforAdmins.GetAdminEnvironment().value, properties.creationType="DefaultTenant").name
     ).value, properties.displayName="yourAppName").name

This, of course, assumes the DefaultTenant environment, but you can adjust as needed.

End result in your test label...the GUID of the app you are looking for.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Thank you @RandyHayes
Isn't there anyway without using the admin connector? 

@pNabin 

Hmmm, none that I am aware of.  But, I haven't researched much on it.  Perhaps others might chime in on it.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

I am not aware of a better option for getting the App Id than what @RandyHayes suggest. however, you may be able to simplify the updating process when moving the app by creating a global variable in the OnStart property and manually set the App Id. Then where ever you use the App Id in your app would use the global variable. When you move the app to a new environment then you would just need to update the global variable in the OnStart and you are done.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
carlosperezsech
Regular Visitor

Do we have an option when publishing the PowerApps solution to AppSource? In that case, when clients install the Canvas App on their environments, there should be an option to automatically set app Id global variable value, not manually.

Edit:

If you do not know the environment nor how to filter it here I propose a solution:

 

 

 

ClearCollect(
    _powerApps;
    Blank()
);;
ForAll(
    PowerPlatformforAdmins.GetAdminEnvironment().value;
    Collect(
        _powerApps;
        PowerAppsforAdmins.GetAdminApps(name).value
    )
);;
Set(
    _appId;
    LookUp(
        _powerApps;
        properties.displayName = "YOUR APP NAME HERE"
    ).name
);;

 

 

 



 

I see that this connector contains privileged functions as Edit-AdminAppRoleAssignment. Can anyone clarify if there are any security issues around using it. i.e. is there a problem using this with a non privileged end user?

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,270)