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 / Loop through a Sharepo...
Power Automate
Unanswered

Loop through a Sharepoint Library and write specific files to a folder

(0) ShareShare
ReportReport
Posted on by

I found this link but it doesn't seem to work for me since I believe my Sharepoint is a Library and not a list:

 

I am rather new to flow/power automate and I'm not really sure how to get this to work.  I have a sharepoint library that has a main folder named "Shared Documents" in that folder are several subfolders (Location A, Location B, etc..) each subfolder has several excel files in it (I only want one with the words ABC... in its file name). 

 

I've created a flow that will download a single file anytime it is updated.  However, I have several folders (and they coulda dd more in the future).  So i wanted to create a flow that would loop through all subfolders and grab all files with ABC in their name and download them. 

 

I can't seem to get the looping/file to work. 

 

This is my latest flow...  any ideas on what I'm doing wrong?  and if this is the wrong place to post this please let me know.

 

Sharepoint_Flow.png

Categories:
I have the same question (0)
  • Jay-Encodian Profile Picture
    2,920 on at

    Hey @Anonymous 

    Can I just check you want the Flow to download a file in SharePoint every time it is updated? If so, you'd simply need to use the SharePoint 'When a file is created or modified (properties only)' trigger action as follows:

    a.png

    HTH

    Jay

    -------------------------------------------------------------------------

    If I have answered your question, please mark your post as Solved.

    If you like my response, please give it a Thumbs Up

     

  • Community Power Platform Member Profile Picture
    on at

    Thanks for the thought @Jay-Encodian ,

     

    I did get it to work when I specify 1 file and say "whenever this is updated/modified" to activate the flow.

     

    The issue I have with that is there are multiple files in different folders that I would need to do this for.  And they could be adding more.  So I would like to (if possible) set up 1 flow that loops through all of the subfolders and grabs any file that ha ABC in the file name. 

     

  • Jay-Encodian Profile Picture
    2,920 on at

    @Anonymous 

    I guess you do this to run on a schedule (once per day or similar? otherwise you'd be obtaining and writing a lot of files unless you add some complexity to your existing Flow to check for an ignore existing files... I would not put that in a Flow which is triggered every time a file is updated / deleted.

    In the flow running on a schedule do something similar to:

    1.png

     

    A.png

     

    NOTE: This example pulls all the files back... if you've a high number of files you should really use a 'SharePoint View' or OData query as opposed to filtering the data in Flow as I have done here... I did it this way as I think it better explains what you need to do conceptually.

    HTH

    Jay

    -------------------------------------------------------------------------

    If I have answered your question, please mark your post as Solved.

    If you like my response, please give it a Thumbs Up

  • Community Power Platform Member Profile Picture
    on at

    Hi @Jay-Encodian 

     

    So your idea of emailing the files to me could theoretically work but would require me to create another flow to activate when these file arrive.


    So I tried combining these workflows to see what i can get.. So now it looks like I've gotten all of the folders and I can see the files that all have "OSL" in their names. The question I have now is how do I download them? I am getting a "File not found" with "Get File Content using path"

     

    So now I'm trying to grab the OSL files that i have found, my next step will be to write them to a folder.

     

    Setup that gets that error:

    FLOW.png

  • Verified answer
    Jay-Encodian Profile Picture
    2,920 on at

    Hey @Anonymous 

    Use the 'Get file content' action configured as follows:

    1.pngHTH

    Jay

    -------------------------------------------------------------------------

    If I have answered your question, please mark your post as Solved.

    If you like my response, please give it a Thumbs Up

  • v-litu-msft Profile Picture
    on at

    Hi @Anonymous,

     

    Has your problem been solved by @Jay-Encodian's advice?
    If your problem has been solved, You could go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

    Best Regards,
    Community Support Team _ Lin Tu

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-litu-msft , @Jay-Encodian 

     

    Sorry for the late response with Christmas and other things going on I've been out of office.

     

    It seems to work but when I run it I get some errors where the get file content errors out in the true area with "not Found" do I need to ignore these somehow?

     

    LogicApp_Error.png

     

     

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard