I have created a flow for some users to select an item on a Sharepoint list of people and get a list of assets assigned to those people on a different sharepoint site. The whole point of the script is that I don't have to give them access to the other sharepoint site but can still return information to them.
However the Get Items function is failing with the below error:
{"odata.error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Attempted to perform an unauthorized operation."}}}
According to the script run it using my powerautomate account to run the Get Item function (that account does have access to the other sharepoint site) and not the account of the user who called the flow in SharePoint (who doesn't have access).
If I give the user access to the sharepoint site the error doesn't occur but I don't want to give them access. The whole point is that I can control what information they can access with Power Automate. Any help or feedback would be greatly appreciated.
I found it - it's the Run Only Users section on the Flow Details (landing) page. I edited there, added my user who I want access and changed the connections to the accounts I wanted used, re tested and it works!! Using PA for nearly two years now on a daily basis and I never knew that was there! Thank you so much Scott!!!
Thanks Scott, where is the Trigger's Details page?
Go to the triggers details page and edit the Run only users.
How is it configured - is it configured to have the users credentials passed through? If so, select your connection instead.
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492