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 Automate / Nothing is being downl...
Power Automate
Answered

Nothing is being downloaded from sharepoint

(1) ShareShare
ReportReport
Posted on by 41

I wrote a flow to go to a document library and download the files onto my desktop (going to go to network folder but using pc as testing).  The flow goes through and does not error out but nothing is displaying in the folder.  When I troubleshoot the flow the variable in the for each loop (Get file content using path) is not populating any data and I cant figure out why. 

My Flow

 

Patrick_Perea_0-1720017264878.png

 

Details of each step

 

Patrick_Perea_2-1720017380144.png

 

Patrick_Perea_3-1720017787797.png

Patrick_Perea_4-1720017878105.png

Patrick_Perea_5-1720017910066.png

Patrick_Perea_6-1720018117799.png

Patrick_Perea_7-1720018874240.pngPatrick_Perea_8-1720018973268.png

 

 

 

 

 

I have the same question (0)
  • Verified answer
    NathanAlvares24 Profile Picture
    1,714 Moderator on at

    Hi @Patrick_Perea !

     

    Please use this flow.

    NathanAlvares24_0-1720032365173.png

     

    Say I have these files in my SharePoint Document Library:

    NathanAlvares24_1-1720032460136.png

    I want these same files in my local folder:

    NathanAlvares24_2-1720032487695.png

     

    Flow details:

    I am using "Get files (properties only)" action as I need only those files and not any other data or folders. I think when you use the action "List folder" action, you will get one first folder as "Forms". We don't want that extra trouble of checking that as well. Instead use this action I suggested and it gets only the files. In my case, I'll get those 2 files data:

    NathanAlvares24_3-1720032685214.png

     

    NathanAlvares24_4-1720032783779.png

    From the above pic, this much data will serve the best in getting your files data.

     

    For each loop for each file.

     

    Next use "Get file content" action. As I said the Identifier from the previous pic. plays an important role in getting your data. This will give you a binary data.

    NathanAlvares24_5-1720032957548.png

     

    Next action is "Convert binary data to file". You have the binary data got from the previous action, use that in this action, mention the main path folder and also give the file name. You need to use FileNameWithExtension to get the same file stored on your system.

    NathanAlvares24_6-1720032996700.png

     

    If you see in your flow in that convert binary data to file action, you used the name. That will save it as non-readable file as it doesn't have the extension of the file. Hence you need to use the FileNameWithExtension.

    NathanAlvares24_7-1720033190811.png

     

    Output:

    Before:

    NathanAlvares24_2-1720032487695.png

     

    After:

    NathanAlvares24_8-1720033257995.png

     

    Code (just copy paste this into your flow):

     

    SET MainSharepointFolder TO $'''C:\\Users\\Username\\Desktop\\Sharepoint files'''
    @@dataset: 'Nathan Sharepoint - https://tangentia.sharepoint.com/sites/NathanSharepoint'
    @@table: 'MainFolder'
    @@folderPath: ''
    @@viewScopeOption: ''
    @@view: ''
    @@'OutputSchema:GetFileItemsResponse': '472971001'
    @@connectionDisplayName: 'Cr327ea_shared_sharepointonline_b2cd1d10'
    External.InvokeCloudConnector Connection: '53a7b581-ebd3-4b71-ad09-91eb167a74a8' ConnectorId: '/providers/Microsoft.PowerApps/apis/shared_sharepointonline' OperationId: 'GetFileItems' @dataset: $'''https://tangentia.sharepoint.com/sites/NathanSharepoint''' @table: $'''fe9a8b54-9a57-4b43-8a2b-e3f1d9b61721''' @GetFileItemsResponse=> GetFileItemsResponse
    LOOP FOREACH CurrentItem IN GetFileItemsResponse.value
     IF CurrentItem['{IsFolder}'] = $'''False''' THEN
     @@dataset: 'Nathan Sharepoint - https://tangentia.sharepoint.com/sites/NathanSharepoint'
    @@id: '%CurrentItem[\'{Identifier}\']%'
    @@connectionDisplayName: 'Cr327ea_shared_sharepointonline_b2cd1d10'
    External.InvokeCloudConnector Connection: '53a7b581-ebd3-4b71-ad09-91eb167a74a8' ConnectorId: '/providers/Microsoft.PowerApps/apis/shared_sharepointonline' OperationId: 'GetFileContent' @dataset: $'''https://tangentia.sharepoint.com/sites/NathanSharepoint''' @id: CurrentItem['{Identifier}'] @inferContentType: True @GetFileContentResponse=> GetFileContentResponse
     File.ConvertFromBinary BinaryData: GetFileContentResponse File: $'''%MainSharepointFolder%\\%CurrentItem['{FilenameWithExtension}']%''' IfFileExists: File.IfExists.DoNothing
     END
    END
    
    # [ControlRepository][PowerAutomateDesktop]
    
    {
     "ControlRepositorySymbols": [],
     "ImageRepositorySymbol": {
     "Repository": "{\r\n \"Folders\": [],\r\n \"Images\": [],\r\n \"Version\": 1\r\n}",
     "ImportMetadata": {},
     "Name": "imgrepo"
     },
     "ConnectionReferences": [
     {
     "ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline",
     "DisplayName": "Cr327ea_shared_sharepointonline_b2cd1d10",
     "InternalId": "53a7b581-ebd3-4b71-ad09-91eb167a74a8",
     "IsDisabled": false,
     "LogicalName": "Cr327ea_shared_sharepointonline_b2cd1d1030914d73acf2e7e0c034dd5d",
     "IsEmbedded": false,
     "ConnectionName": "shared-sharepointonl-e375c369-f52d-4c7e-a704-11a21f81186a",
     "ConnectionDisplayName": "nalvares@tangentia.com"
     }
     ]
    }

     

     

    I hope this helps.

  • Patrick_Perea Profile Picture
    41 on at

    That got me past my block, thank you so much

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 229 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 227

#3
Haque Profile Picture

Haque 181

Last 30 days Overall leaderboard