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 / Find or Remove Item fr...
Power Automate
Unanswered

Find or Remove Item from a List where Value contains a wildcard

(0) ShareShare
ReportReport
Posted on by

I have a list of files and I need PAD to look at this list and give me the list item that matches a wildcard ("SGC").

Is there a way to do this?

 

I tried "Remove item from list" with the Value of anything that doesn't end in "SGC" but it didn't like the syntax.

 

From experimenting, I've been able to parse a list with a regex wildcard but instead of giving me the list item where it found the "SGC" match, it simply stored the matched text. 

 

Suggestions appreciated 🙂 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @MTIncPower 

    Try this:

    1) 'Get files in folder' to get the list of files (%Files% as output variable)

    2) 'For each' CurrentItem in Files

    3) 'If' %CurrentItem% (First operand) Does Not Contain (operator) 'SGC' (Second operand) then

    4) 'Remove item from list' > Remove item by Value, With value = %CurrentItem%, From list = %Files%

    5) 'End' (If's end)

    6) 'End' (For each's end)

     

    At the end, %Files% will have only items with 'SGC'. 

  • Daniel_Pa Profile Picture
    244 on at

    Yasunm is right - I'll just add a screenshot for your convenience:

    filter file list.png

  • Riyaz_riz11 Profile Picture
    4,214 Super User 2026 Season 2 on at

    Hi @MTIncPower ,

     

    You can Try in this way

    Try this:

     Get files in folder' to get the list of files (%Files1% as output variable)

    For each CurrentItem in %Files1%

    If' %CurrentItem% (First operand) Does Not Contain (operator) 'SGC' (Second operand) then

    Remove item from list' > Remove item by Value, With value = %CurrentItem%, From list = %Files1%

    End (If's end)

    End (For each's end)

     

    At the end, %Files1% will have only items with 'SGC'. 

     

    If it works Please mark as a solution, so it will help even others also.

    Regards

    Ahammad Riyaz

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Are all the files in one folder to begin with?  The "Get files in folder" command has a file filter.

    File filter *SGC should only pull in those files.  This says, it must end in SGC to be pulled in to the list.

    Update:  Adjain is correct...unless the file ends in .SGC, you will need the * after.

  • adijain Profile Picture
    Microsoft Employee on at

    Hi @MTIncPower You can use this directly 

    adijain_0-1626471841577.png

    Note the two * before and after SGC in the file filter parameter. (*SGC*)

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 229 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 223 Super User 2026 Season 2

#3
Valantis Profile Picture

Valantis 136 Super User 2026 Season 2

Last 30 days Overall leaderboard