I recently came into a situation where I needed to add a user as co-owner for all of the flows under another user account, where there are lots of Flows created.
Did I add the user manually in every flow? No, I created a Flow to add the user as owner in my Flows!
In this post, I will quickly show how to build this simple and useful Flow.
In order to easily trigger the Flow manually, create it with the recurrence trigger. The frequency can be anything, but I like to set this to at least one month to avoid the hassle.
Next action: In order to get the user Id and add it as Flow owner easily, use the Get User Profile action, which accepts an e-mail address as parameter. And include here the e-mail address of the user that should get co-owner access in the Flows.
After this, use the List My Flows action for the desired environment, so you’ll retrieve a list of all your flows. Then add a Modify Flow Owners Action as next action using Flow Name from previous List My Flows action as the Flow parameter for the selected flow in the Modify Flow Owners action. As soon as this value is selected, Power Automate identifies it is an array of items from the previous action and creates a loop to iterate through all items.
Then to wrap up the flow, use the User Id from the Get user profile action to add the user as Owner. As we are going to add a user and not a group, select User as the user type.
Save the flow, and it is ready to be executed.
Find the flow under My Flows menu and click the Run button below.
Wait for it to be executed, and then log into the new account to see the magic.
Boom!! All flows successfully shared.