Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

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

Posted on by 35
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:
  • Pstork1 Profile Picture
    Pstork1 64,090 on at
    Upload a file to a SharePoint folder via Power Apps without being an owner/member of the site.
    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.
  • FR-27081326-0 Profile Picture
    FR-27081326-0 35 on at
    Upload a file to a SharePoint folder via Power Apps without being an owner/member of the site.
    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

  • Srini007 Profile Picture
    Srini007 2,817 on at
    Upload a file to a SharePoint folder via Power Apps without being an owner/member of the site.
    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
  • Suggested answer
    Pstork1 Profile Picture
    Pstork1 64,090 on at
    Upload a file to a SharePoint folder via Power Apps without being an owner/member of the site.
    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

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard