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 / Extract files from fol...
Power Automate
Unanswered

Extract files from folders which names exist in an Excel sheet and ignore the rest

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Dear Community,

 

I am struggling with a task of extracting files from folders (and subfolders) with names that exist in an Excel list and ignoring the the rest of the folders.

 

Photos Folder: consists of 7k+ subfolders and in each subfolder there are two sub-folders. Each folder and its subfolder has a number in the name (the two subfolders also have different resolutions in the brackets). Example:

 

Photos Folder / 10001 / 10001 (750x750px)/[photos].jpg AND 10001 (1500x1500px)/[photos].jpg

 

Excel list: ~1000 number that I need to extract the files (photos) for and choose them only from 1500x1500px subfolder while ignoring the rest of the 6k folders.

 

The extracted photos need to be placed in one single folder.

 

I have been able to get the part of the task done with the automation below however it extracts all of the photos which I would like to avoid as it is time intensive (each sub-folder has a couple of photos) and required filtering the rest out.

patryk_st_0-1686161110249.png

Many thanks for any hints!

 

 

I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Resolved so no more help needed.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Crate List %Photos%
    Extract data from Excel %Exceldata% (datatable)

    extract column from datatable to %List%
    For each %num% in %List%
        get subfolder from Photos/%Num%/ that contains 1500 to %subfolder%

        Get files from subfolder to %Files%
        add %Files% to %Photos%

    end (for each)

    move %photos% to %Newpath%

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 248 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 160 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 142 Super User 2026 Season 2

Last 30 days Overall leaderboard