The Get files SharePoint actions for flows in Power Automate lets you get items from a document library. And by items we mean both files and folders. But most of the time we just want to work with files, so we need the Get files actions to return a collection of files only and to exclude any folders.
Fortunately, there is a property we can check to see whether the item is a folder: isFolder

The actual name of this property is “{IsFolder}” but the Get files SharePoint actions doesn’t allow us to use this name in Filter queries. However, we can use an alternative property name for “{IsFolder}” called FSObjType and this works with Filter queries.
Using the FSObjType property
The following Filter query will return only files from the Get Files action. Folders will not be included in the search results. It uses the File System Object type property (FSObjType):

FSObjType eq 0 will return Files only
FSObjType eq 1 will return Folders only
For other types see: FileSystemObjectType enumeration.
Using the isFolder property within a Flow
In the example below the isFolder property is used inside a Condition. This method does have its uses, but it is much slower than using FSObjType in a query filter. This is because the Get Files action below returned an unfiltered collection of items, so we now need to check each item to determine whether the item is a file or a folder:

Leave a Reply