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 / Detecting folders then...
Power Automate
Unanswered

Detecting folders then runs the action

(0) ShareShare
ReportReport
Posted on by 12

Hello newbie here i would like to create a flow that roughly does this:

Goes to a Folder 

Detects which files start with 001,002,003.....

Runs the same flow for each file

 

Btw i also use photoshop so it needs to detect itself in Desktop>New folder>003 xxxxx xxxx

Idk if i explained good enough

Thanks for the help!

I have the same question (0)
  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Get Files (define folder path) and set files to 001*...set the variable to %Files001%

    For each %CurrentItem% in %Files001%

        'do something

    End (For Each)

     

    Repeat for 002, 003, and so on.

     

    If you have a lot of 001 through whatever, then make a txt file with all the possibilities that you want to iterate through on a separate line, for example:

     

    001

    002

    003

    004

    005

    006

     

    Then read txt file to list

    Create new List %AllFiles%

    For each %CurrentItem% in %List%

        Get files [filepath] with files %CurrentItem%* to %Files%

        Add %Files% to list %AllFiles%

    End (for each)

    For each %CurrentItem% in %AllFiles%

        'do something

    End (For Each)

     

  • Sundeep_Malik Profile Picture
    6,501 on at

    Hey @Age2220 

     

    Do something like this:

     

    Sundeep_Malik_0-1668101241379.png

    Sundeep_Malik_3-1668101748199.png

     

     

    1) List Files in a folder

    2) Create a new list

    3) Set variable to 0 [It will act as iteration to fetch file name]

    4) Run a for each loop on files you are getting from list files in a folder action.

    5) Then set a new variable to %Files[NewVar].Name%

    This will go and fetch each files name

    6) Then use if action. [You can set the value to 0, or 00 as per your choice]

    Sundeep_Malik_1-1668101408036.png

    7) Inside the if add the current item to the list you created above

    8  Then after the if ends, just increase/increment the variable by 1.

    9) After the for each loop ends run a for each loop on the newly created list. Then perform whatever you want.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 671

#3
Haque Profile Picture

Haque 551

Last 30 days Overall leaderboard