web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Upload a file to a Sha...
Power Automate
Suggested Answer

Upload a file to a SharePoint folder via Power Apps without being an owner/member of the site.

(0) ShareShare
ReportReport
Posted on by 69
Hi all!

We have an app that needs to upload a file to a specific SharePoint folder.
We use the HTTP SEND REQUEST node in Power Automate to check if the user is authorized. If they have the correct permissions for the folder, the file is uploaded successfully.

The URI used in the HTTP SEND REQUEST node in Power Automate is:
_api/web/getfolderbyserverrelativeurl( /sites/sitename/path')/ListItemAllFields/RoleAssignments?$expand=Member/Users,RoleDefinitionBindings

Two issues have emerged:

  1. The user can only upload the file if they are an owner of the site and have access to the shared folder.

  2. If the user is a member of the site and has the folder shared with them, they cannot upload the file and receive the following error:

    DocumentLibrary_SP_Permissions.Run failed: { "error": { "code": 502, "source": "default-eccd734e-7022-4709-aba5-a5dd77929e27.05.common.europe.azure-apihub.net", "clientRequestId": "d80efb5a-851a-4e73-b55d-fbf0e8820ee9", "message": "BadGateway", "innerError": { "error": { "code": "NoResponse", "message": "The server did not receive a response from an upstream server. Request tracking id '08584699259120012869458064177CU151'." } } }

  3. If the user hasn't access in the S.P site, the error that receive is Error when trying to retrieve data from the network: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) clientRequestId: 904b01fb-15c0-45cd-af9b-0a1ac3f25f34 serviceRequestId: 912864a1-10d1-a000-8f08-5869b0204160

The goal, however, is to share only the folder with the user (without adding them as an owner or member of the site) and have the app work properly.

Can anyone help?

Thanks.

Categories:
I have the same question (0)
  • Suggested answer
    Pstork1 Profile Picture
    68,717 Most Valuable Professional on at
    Take a look at the following video.  If you build the app and flow in a solution file you can use the Run Only settings to modify what security context the file is uploaded under.  That is the only way I know of to do what you want if the user doesn't have sufficient permissions for the underlying site/library.  https://www.youtube.com/watch?time_continue=8&v=ts-ggDAy7IQ&embeds_referring_euri=https%3A%2F%2Fwww.bing.com%2F&embeds_referring_origin=https%3A%2F%2Fwww.bing.com&source_ve_path=MjM4NTE
  • Srini007 Profile Picture
    3,327 Super User 2025 Season 2 on at
    Hi,
     
    when using HTTP requests via Microsoft Graph API in Power Automate, the key challenge remains that the user or service account running the flow must have the correct permissions to perform the upload. If the user doesn’t have access, you must use either a service account with the necessary permissions or configure the flow with delegated permissions from a user who has the appropriate access.
     
    If I have answered your question, please mark it as the Answered. If you like my response, please give it a Like.
    Regards,
    Srini
  • FR-27081326-0 Profile Picture
    69 on at
    Hi !

    Thank you for your support! This way, even though the user is a member, the application works. However, when I change their permission from write to read, they automatically become a viewer with read permissions, and the app stops working.

    It only works if the user is a member of the site.

    Is there a way to make it work with the viewer role/without any write permissions?

    Thanks

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at
    That is exactly what my reply does. You have to use a flow triggered from the Power App with both of them in a solution and the Run ONly user setting set to a connection with edit access. But the user invoking the flow then doesn't need Edit access.  Check the video I posted.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard