Hi,
I'm trying to create a flow to get only some files.
How can I filter by docx, doc, xls, xlsx, ppt, pptx?
Thanks.
Hello @AngelPA, This is an internal property name of SharePoint. There are two others as well:
FileLeafRef = Name of the file
FileRef = Relative URL path to the file
how you identify that the name of the fild is "File_x0020_Type"?
Your solution works perfectly, and is faster.
Thank you.
How can I run this in a specific folder inside "Shared Documents"?
This should work for you:
File_x0020_Type eq 'xls' or File_x0020_Type eq 'doc' or File_x0020_Type eq 'ppt'
I didn't test it.
Yes I noticed that takes too long because we have multiple files.
With your solution, how can I search for xls, doc, ppt in the same filter? It's possible?
Hi!
There is a better and more effecient way to do this. Filtering result array is time consuming for thouthands of documents.
Just use this oData filter under Advanced section of the "Get files" action:
File_x0020_Type eq 'xls'
You can find example of usage in this article.
This approach is better because it returns only required files.
Barry,
It works.
Thank you.
Hi @Anonymous,
You could get all files information first by using Get files(properties only).
Then use Filter array to filter files, if the file name with the extension ends with the expected file format.
Use endswith() function to make a decision.
Formula reference:
@or(endswith(item()?['{FilenameWithExtension}'], '.docx'),endswith(item()?['{FilenameWithExtension}'], '.doc'),endswith(item()?['{FilenameWithExtension}'], '.xls'),endswith(item()?['{FilenameWithExtension}'], '.xlsx'),endswith(item()?['{FilenameWithExtension}'], '.ppt'),endswith(item()?['{FilenameWithExtension}'], '.pptx'))
Image reference:
Please take a try.
Best Regards,
Barry
Michael E. Gernaey
9
Super User 2025 Season 1
rzaneti
7
Super User 2025 Season 1
lbendlin
4
Super User 2025 Season 1