Archive

Posts Tagged ‘Set App Owner’

Power Apps | Change App Owner using Power Automate Flow

November 4, 2022 2 comments

Assume that you have a canvas app with Owner as ‘User 1’ and you would want to make ‘User 2’ as Owner of the App.

We have couple of options.

In this article lets see how to use Power Automate Flow to change the Owner. Following is how the completed flow looks like.

Key in this flow is ‘Set App Owner’ Action and following are the parameters.

NameKeyRequiredTypeDescription
Environment NameenvironmentTruestringName field of the Environment.
PowerApp NameappTruestringName field of the PowerApp.
API Versionapi-versionstringThe date value of the API version.
Content TypeContent-TypestringThe content type of the API request.
Role For Old App OwnerroleForOldAppOwnerstringThe role name for the old app owner. Choose from CanView, CanViewWithShare, or CanEdit.
New PowerApp OwnernewAppOwnerstringThe principal object ID of the new owner.

Lets see step by step process to build the flow.

Step by Step budling flow:

  • Create a new flow as shown below.
  • As mentioned, key component of this flow is ‘Set App Owner’ Action and in the next steps, we will see how to pass parameters to ‘Set App Owner’ Action.
  • First we need to capture the ‘New PowerApp Owner’ parameter which is ‘Principal object ID’ of the User.
    • Note: ‘Principal object ID’ is not GUID of ‘System User’ in Dataverse. Its Azure Active Directory ID.
  • Add a ‘Get user profile (V2)’ action of Office 365 Users connector to capture the ‘Principal object ID’ of the User.
  • Rename the ‘Get user profile (V2)’ to ‘GetUserProfile’. (Optional Step)
  • Set “User (UPN)” as the User Id of the new Owner.
  • Now add ‘Set App Owner’ action.
  • Set ‘New PowerApp Owner’ as ‘Id’ from the output of previous ‘GetUserProfile’ action.
  • For ‘Environment Name‘ parameter, go to Power Apps maker portal, open ‘Settings -> Developer resources’.
  • Copy ‘Environment ID’ and paste in ‘Environment Name‘ parameter of ‘Set App Owner’ action.
  • For ‘PowerApp Name‘ parameter, go to Power Apps maker portal, open ‘App -> Details’.
  • Copy the ‘App ID‘ and paste in ‘PowerApp Name’ parameter of ‘Set App Owner’ action.
  • For ‘Role For Old App Owner‘ parameter, either you can leave or provide ‘CanView’.
  • Leave ‘API Version‘ and ‘Content Type‘ as default.
  • You should see the flow as below once you follow all mentioned steps.
  • That’s all needed!. Run the flow and you should see the owner of the App to the new user mention in the flow.

🙂

Advertisement