Power Automate filter to get only Word (or Excel or PDF…) documents
Posted On August 23, 2020
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:
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.