Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 78MlLUfrbtkfbqSX5YFUeH
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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

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

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - General Discussion

#1
ankit_singhal Profile Picture

ankit_singhal 7 Super User 2025 Season 1

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 4 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 2 Super User 2025 Season 1

Overall leaderboard
Loading started