cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BP-WS
Helper I
Helper I

Running Flow as an Administrator Account (Permissions)

Hello,

 

I currently have a flow, which connects to SharePoint online and generally works. However, when some users that trigger the flow - who do not have access to the appropriate SharePoint site - the flow is then failing with "Unauthorized Access Error ". I was hoping that I may be able to resolve this by using the "run only users" feature, but this option is not available for this flow.

 

Does anyone have any ideas of how I can run the flow with a specific user account each and every time (even the service account may do!), instead of using the respective users' permissions each time it's ran by a different user (and this therefore failing for some users who do not have permission to the SharePoint site)?

 

Thanks,
B

6 REPLIES 6
Pstork1
Dual Super User
Dual Super User

That depends on the trigger being used.  I suspect you are using a manual trigger, like for a selected item. If that is the case then the flow is running in the context of the user and there is no way to change that.  Flows with automated triggers, like when an item is modified, will run in the context of the maker of the flow or whatever account they used on the connector. So the key is to make sure you use either a recurrence or automatic trigger.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

@Pstork1 , thank you very much for that response, very helpful.

 

I've discovered that the flow I'm trying to run with admin-level privileges (or a user with sufficient privileges), is triggered from a Power App. Do you therefore know what options I have in getting this flow to run as an admin, instead of the respective user that triggers the flow from using the Power App (eg. from pressing a button within the app)?

 

Thanks,

B

As I mentioned.  If the flow is triggered by a Power App then it will run in the security context of the user running the app.  There is no way to change that or run it with elevated privileges. Your only real choice would be to use a list as an intermediary.  Have a flow kicked off by the Power App that creates a record in a list.  Then have the flow you need admin privileges for run using the When an item is created trigger.  That flow will then run in the context of the maker.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

@Pstork1 ,

 

Thanks for that additional info. I did come across this guide in the meantime - which advised that if you use a "PowerApp (V2)" trigger, it will then enable you to use the "Run Only User" functionality?

 

Thanks,

B

The run only user is a loophole that can be used to run the flow triggered by the power app using another user's security context. I had forgotten about that exception.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

@Pstork1 ,

 

Okay, so I think that may suffice for what I'm trying to achieve in this case 🙂

 

Thanks,

B

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,679)