How to filter queries based on file type or file name?

there is no example to filter queries based on file type or file name . its talking only about the content of the file

Hi @seetharaman

can you give more context on where you are trying to filter and what activities or expressions you are trying to use?

cheers

Hi Anil ,
Thanks for your response.
i will try to be clear.
lets say below are the field from one drive / sahrepoint.


I want to delete those excel files which has the word " FedEx" in the name.
in other words , I do not want to delete the folder and the sample excel file.
what would be the query to do so ?

Hi @seetharaman

query would be “FedEx”

Make sure you give the subfolder path as well

cheers

i did try that it worked as well. my question is larger.
just to be clear I have given this sample.
say eg : Using Find Files and Folders Activity
this article talks about similar scenario and it says , if we give say “fedEx” it will search for document which has the word “Fedex” inside it and consider that also.
where in , here I am talking about a specific peropery file name .
same goes for file type .
if you can refer me some article which comprehensively explains the query part very clear, It will be of great use.

Hi @seetharaman

You cannot restrict to files or folders using the query. You need to either use driveitem.Name to check if it is a folder or file .

Alternate to this we have for each file/Folder. In that you have property to select only files or only folders.

And if you want the file type also then you have to use a loop and check for the required extensions or try using “Fedex” and “.xlsx”

I hope this is what you are asking for

But yes there is no examples or some site which gives this other than official Microsoft

but again this is not exhaustive list

cheers

thank you for the answers.

1 Like