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 / wildcard entries in sh...
Power Automate
Suggested Answer

wildcard entries in sharepoint getfiles

(0) ShareShare
ReportReport
Posted on by 404
Hello,
 
i want create a PA that delete files older than 6 months.
i created the flow so far so good.
My question is wildcards are they allowed in the limit entries to folder?
Because, i have a tree structure like this
 
1- documents/name1/file.doc
2- documents/name1/Archives/file.doc
3- documents/file.doc
4- documents/name2/file.doc
5- documents/name2/Archives/file.doc
6- documents/nameN/file.doc
7- documents/nameN/Archives/file.doc
8- documents/nameN/Archives/file2.doc
 
and i only want to delete files in points {2,5,7,8}
 
 
Thanks
Categories:
I have the same question (0)
  • Suggested answer
    Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at
    Hello @GeekAlf_Pro,
     
    I reviewed your requirement and I see that the archived files are spread across different document folders. So we can’t directly apply a filter in the “Get files” action.

    Instead, you can handle this inside an Apply to each loop. Just add a condition to check if the file path contains “Archive”. If that condition is true, then you can proceed to delete the file.

    Also, I would suggest adding one more filter for the file type: FSObjType eq 0. This will ensure that only files are returned. (This you need apply in get files action beside the created date filter).

    FSObjType eq 0

    Right now, with your current filter, it may also bring folder entries along with files. So by applying this condition, you’ll properly restrict the output to files only.

    ---------------------------------------------------------------------------
    Glad it helped 🙂
    If this fixed your issue,
    please click “Does this answer your question?” to mark it as verified so others can find the solution easily.
    A Like 👍 is always appreciated, and I’m around if you need more help @Kalathiya
  • Suggested answer
    Tomac Profile Picture
    4,153 Moderator on at
     
    While @Kalathiya's point is an important one (it will prevent the action from returning folders as well as files), to answer your question directly the option "Include Nested Items" will go through all contained folders when set to yes. If you don't want it to recursively go through all lower folders, set that option to No.
  • Suggested answer
    David_MA Profile Picture
    14,956 Super User 2026 Season 1 on at
    To me, the simplest thing to do would be to configure the get files action to limit it to one of the folders that applies:
    • 2- documents/name1/Archives/file.doc
    • 5- documents/name2/Archives/file.doc
    • 7- documents/nameN/Archives/file.doc
    • 8- documents/nameN/Archives/file2.doc
     
    Then just duplicate the steps for the other three folders. Or you could set the workflow up to process one folder and get it working. Once it is working, do a save as on the workflow and adjust it for the next applicable folder so that you have four workflows; one for each folder.
     
    Note, if you don't want the flow to process any subfolders under the Archives folder level, be sure to set include nested items to no.
  • GeekAlf_Pro Profile Picture
    404 on at
    Hello,
     
    Thanks for your responses, i will test
     
    Have a good day

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 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard