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
Solved! Go to Solution.
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.
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.
Hmmm, none that I am aware of. But, I haven't researched much on it. Perhaps others might chime in on it.
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.
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?
(also works with the powerapps for makers connector)
my problem is I want to show whether I'm on the test or productive environment - if the program name is identical, it doesn't work
Why don't you have a Sharepoint list in each environment with the name of the environment and any other environment specific details. The app could read that list.
Hi people.
I like the idea of having the ID in the settings table in sharepoint. (I dont have any admin rights)
Does the AppID change if I update to a new version of my App?