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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Power Automate Upload ...
Power Apps
Answered

Power Automate Upload File via Power App to Sharepoint folder

(0) ShareShare
ReportReport
Posted on by 23

I am trying to trouble shoot a flow that copies a file to a sharepoint folder from Power Apps.

 

It did work, but now for some reason all the files (.pdf .docx .png) now are corrupted when you try to open them in sharepoint , with the exception of a .txt file?  Any thoughts?

 

The flow is set up as follows:

mwackers_0-1705426065702.png

 

Here is a peek at the code:

{
    "inputs": {
        "host": {
            "connectionName": "shared_sharepointonline",
            "operationId": "CreateFile",
            "apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline"
        },
        "parameters": {
            "dataset": "https://##########.sharepoint.com/sites/CD-MISGISProgress",
            "folderPath": "/Land Bank Expressions of Interest/@{triggerBody()['text_1']}",
            "name": "@triggerBody()['text_2']",
            "body": "@base64ToBinary(triggerBody()['text'])"
        },
        "authentication": "@parameters('$authentication')"
    },
    "runtimeConfiguration": {
        "contentTransfer": {
            "transferMode": "Chunked"
        }
    },
    "metadata": {
        "operationMetadataId": "10945ad8-e511-46e6-860f-3f44997838d8"
    }
}
 
 
The test shows the following raw input:
{
    "host": {
        "connectionReferenceName": "shared_sharepointonline",
        "operationId": "CreateFile"
    },
    "parameters": {
        "dataset": "https://#########.sharepoint.com/sites/CD-MISGISProgress",
        "folderPath": "/Land Bank Expressions of Interest/Case_LB_18_xluf7vzfv",
        "name": "Decision Memo for GINAvARPA1.docx",
        "body": {
            "$content-type": "application/octet-stream",
            "$content": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxzdmcgdmVyc2lvbj0iMS4xIg0KCSB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWxuczphPSJodHRwOi8vbnMuYWRvYmUuY29tL0Fkb2JlU1ZHVmlld2VyRXh0ZW5zaW9ucy8zLjAvIg0KCSB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjI3MHB4IiBoZWlnaHQ9IjI3MHB4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyNzAgMjcwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCgk8ZyBjbGFzcz0ic3QwIj4NCgkJPHJlY3QgeT0iMC43IiBmaWxsPSIjRTlFOUU5IiB3aWR0aD0iMjY5IiBoZWlnaHQ9IjI2OS4zIi8+DQoJCTxwb2x5Z29uIGZpbGw9IiNDQkNCQ0EiIHBvaW50cz0iMjc3LjksMTg3LjEgMjQ1LDE0My40IDE4OC42LDIwMi44IDc1LDgwLjUgLTQuMSwxNjUuMyAtNC4xLDI3MiAyNzcuOSwyNzIiLz4NCgkJPGVsbGlwc2UgZmlsbD0iI0NCQ0JDQSIgY3g9IjIwMi40IiBjeT0iODQuMSIgcng9IjI0LjQiIHJ5PSIyNC4zIi8+DQoJPC9nPg0KPC9zdmc+"
        }
    }
}
 
 
And the following raw output:
   "Vary": "Origin,Accept-Encoding",
        "X-NetworkStatistics": "0,4204800,0,0,7,0,17967",
        "X-SharePointHealthScore": "1",
        "X-MS-SPConnector": "1",
        "X-SP-SERVERSTATE": "ReadOnly=0",
        "DATASERVICEVERSION": "3.0",
        "SPClientServiceRequestDuration": "245",
        "SPRequestDuration": "246",
        "X-DataBoundary": "NONE",
        "X-1DSCollectorUrl": "https://mobile.events.data.microsoft.com/OneCollector/1.0/",
        "X-AriaCollectorURL": "https://browser.pipe.aria.microsoft.com/Collector/3.0/",
        "SPRequestGuid": "2f520343-05ff-417c-a3e2-0f0081df7dfa",
        "request-id": "2f520343-05ff-417c-a3e2-0f0081df7dfa",
        "MS-CV": "QwNSL/8FfEGj4g8Agd99+g.0",
        "Strict-Transport-Security": "max-age=31536000",
        "X-FRAME-OPTIONS": "SAMEORIGIN",
        "Content-Security-Policy": "frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com *.powerapps.com *.yammer.com engage.cloud.microsoft *.officeapps.live.com *.office.com *.microsoft365.com *.stream.azure-test.net *.microsoftstream.com *.dynamics.com *.microsoft.com onedrive.live.com *.onedrive.live.com securebroker.sharepointonline.com;",
        "MicrosoftSharePointTeamServices": "16.0.0.24406",
        "X-Content-Type-Options": "nosniff",
        "X-MS-InvokeApp": "1; RequireReadOnly",
        "Timing-Allow-Origin": "*",
        "x-ms-apihub-cached-response": "true",
        "x-ms-apihub-obo": "false",
        "Cache-Control": "max-age=0, private",
        "Date": "Tue, 16 Jan 2024 17:08:29 GMT",
        "P3P": "CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"",
        "X-AspNet-Version": "4.0.30319",
        "X-Powered-By": "ASP.NET",
        "Content-Type": "application/json; charset=utf-8",
        "Expires": "Mon, 01 Jan 2024 17:08:29 GMT",
        "Last-Modified": "Tue, 16 Jan 2024 17:08:29 GMT",
        "Content-Length": "804"
    },
    "body": {
        "ItemId": 391,
        "Id": "%252fLand%2bBank%2bExpressions%2bof%2bInterest%252fCase_LB_18_xluf7vzfv%252fDecision%2bMemo%2bfor%2bGINAvARPA1.docx",
        "Name": "Decision Memo for GINAvARPA1.docx",
        "DisplayName": "Decision Memo for GINAvARPA1.docx",
        "Path": "/Land Bank Expressions of Interest/Case_LB_18_xluf7vzfv/Decision Memo for GINAvARPA1.docx",
        "LastModified": "2024-01-16T17:08:30Z",
        "Size": 579,
        "MediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
        "IsFolder": false,
        "ETag": "\"{C6060DC2-54F1-43F4-B55B-E0140617D13F},1\"",
        "FileLocator": "dataset=aHR0cHM6Ly90aGVjbGV2ZWxhbmRvaGlvLnNoYXJlcG9pbnQuY29tL3NpdGVzL0NELU1JU0dJU1Byb2dyZXNz,id=JTI1MmZMYW5kJTJiQmFuayUyYkV4cHJlc3Npb25zJTJib2YlMmJJbnRlcmVzdCUyNTJmQ2FzZV9MQl8xOF94bHVmN3Z6ZnYlMjUyZkRlY2lzaW9uJTJiTWVtbyUyYmZvciUyYkdJTkF2QVJQQTEuZG9jeA=="
    }
}
Categories:
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @mwackers ,

     

    Here is a blog where you can find the exact same topic and detailed steps:

    Power Apps Easiest Way To Upload Files To A SharePoint Document Library (matthewdevaney.com)

     

    I think the issue is the file content passed from App to flow.

     

    Best regards,

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard