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 / Filtering in get files...
Power Automate
Unanswered

Filtering in get files folder action using ??? character/Code

(0) ShareShare
ReportReport
Posted on by 48

Filtering in get files folder action using ??? character. 

 

Kindly suggest, how to filter files like XXXX.XXX? I need to filter after extension that is should only have 3 numbers after '.' (DOT)as extension is number.

 

I have the same question (0)
  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Could you elaborate your requirements ?

     

    But, it seems trying to filter the files which has 3 letter after extension(like .txt, .xls etc). Use wildcard option to filter the file. If yes, then use *.??? to filter the files.

    Kaif_Siddique_0-1675540356164.png

     

    Regards

    Kaif

  • UserCflows_12 Profile Picture
    48 on at

    Hello

    Thank you for the reply. But I have numbers after dot.

     

    Ex: FILENAME.128, somehow it wasn't working for numbers.

    Mainly i want to remove files having

    FILENAME.128(1)

     

    Kindly mention

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    What about just *(

     

    then it would grab anything with parenthesis. 

  • UserCflows_12 Profile Picture
    48 on at

    Thank you for the response ,  but basically i don't want to filter them with parenthesis.

     

    My files for ex: Filename.xxx(1), Filename.xxx(2),Filename.xxxx. It shouldn't filter any of these in GET FILES IN FOLDER.

     

    Need only correct order files Filename.XXX, this is format I need , only filter those. Only 3 digits/number in extension. please suggest.

  • UserCflows_12 Profile Picture
    48 on at

    Hello, 

     

    can anyone kindly reply to this. Needing suggestion on this.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    You are not going to like this answer:

     

    The Get files uses basic command prompts (which is the same as the search bar in the upper right corner of a Windows Explorer box).  Everything I read says that .### or some equivalent isn't an option.  There is just * (for any number of characters before or after and ?.

     

    Get files *.??? (this will pull all files with numbers, letters, or combos of both, but at least it will limit to those with extensions.

    For each %CurrentItem% in %Files%

        Convert %CurrentItem.Extension% to Number; save as %ExtensionTest%

            On Error - Go to Label "SkipFile"

        If %ExtensionTest% > 0

            'do whatever you need to with the file

        End (if)

        Label: SkipFile

    End (for each)

     

    I think this is your best bet given that you can't just filter for .###; it should skip the unneeded files very quickly.

     

    Another option would be creating a new list, do the first part of the logic through the whole list and adding files you want to do to a new list, then just running a for each on the new list:

    If %ExtensionTest% > 0

        'add %CurrentItem% to %NewList%

    End (if)

     

    'then just for each on %NewList% since you've already validated all these file extensions.

     

    Good luck!

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Maybe this approach wil lwork too:

     

    1. Get all files in folder - no filtering --> %FilesAll%

    2. Get "broken" files with *(  filtering as@MichaelAnnis ssuggested --> %BrokenFiles%

    3. Use action "Subtract lists" and subtract %BrokenFiles% from %FilesAll%

    4. You end up with list of "correct" files

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    I agree with @momlo , this may work faster. I would limit #1 to *.??? Instead at all files. 

    good luck!

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 482

#2
11manish Profile Picture

11manish 280

#3
David_MA Profile Picture

David_MA 268 Super User 2026 Season 1

Last 30 days Overall leaderboard