Power Automate filter to get only Word (or Excel or PDF…) documents

Do you need to filter only some of the documents in a library using Power Automate? E.g. just Word documents to convert them to PDF?


To use Power Automate to filter a specific documents we need to understand document properties first. Every document uploaded into SharePoint has an internal property FileLeafRef, which is basically the Name of the document including extension, e.g. myDocument.docx. Knowing this, you can use Filter Query in the Get files (properties only) (SharePoint) in the following format:

substringof('.docx', FileLeafRef)

This query will tell the action to return only files where ‘.docx’ string is part of the file name (incl. extension). That means, only Word documents will be filtered.

You can replace the .docx with any other file extension you need. And you can even sort the returned files if needed.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Add a Comment

Your email address will not be published. Required fields are marked *