Skip to main content

Notifications

Community site session details

Community site session details

Session Id : vv6vv+Qe2K9qGfMEHNLudy
Power Automate - General Discussion
Answered

Extract PDF Files from Subfolders and Copy into New Folder

Like (0) ShareShare
ReportReport
Posted on 18 May 2023 03:50:46 by 6

Hi all! I'm new to Power Automate and am looking for a way to do the following:

 

File structure: Root Folder > Folders (with different names) > PDF files

 

I have many subfolders inside my root folder, all named with names of people, and I want to iterate through each subfolder, and copy and paste a specific PDF document into a new folder (to be done for all subfolders).

 

Restrictions: The documents can only be on OneDrive only, due to my restricted access to certain SharePoint folders that I am working with (but I am still able to download the SharePoint documents and upload them onto my personal OneDrive to work with).

 

Any help would be great. Thank you!

  • sherwinsherlose Profile Picture
    6 on 25 May 2023 at 02:39:12
    Re: Extract PDF Files from Subfolders and Copy into New Folder

    Hi @v-wenjuan-msft ,

     

    My files are only embedded by one level. Whatever you have suggested works!

     

    Thanks a lot!

  • Verified answer
    v-wenjuan-msft Profile Picture
    Microsoft Employee on 18 May 2023 at 06:57:54
    Re: Extract PDF Files from Subfolders and Copy into New Folder

    Hi @sherwinsherlose ,

     

    I will show you a demo of how to get into subfolders and retrieve files there.

    Here's my flow:

    vwenjuanmsft_0-1684392700236.png

     

    1. List files in root folder.

    2. Filter array, retrieve objects of folders from outputs of above action.

    3. Apply to each, list files in subfolders. and repeat filtering out folders which still embedded with further subfolders.

     

    You have to confirm how further subfolders are embedded. It determines how many loop you need to set to iterate all subfolders.

     

    Community Support Team _ Wenjuan Zou

    If this post helps, then please consider Accept it as the solution to help the other members find it.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Automate - General Discussion

#1
stampcoin Profile Picture

stampcoin 23

#2
Pstork1 Profile Picture

Pstork1 20 Most Valuable Professional

#3
Gprior Profile Picture

Gprior 19

Overall leaderboard
Loading started