“I want to order the output of the Power Automate ‘Get files’ action to build an HTML table. Order by the Sub Folder Name that houses the file, ascending order.”
If you want to order files in Power Automate, the only option you have is to sort them directly in the ‘Get files’ action. Currently it’s not possible to sort them later (but you can vote for the sorting functionality).
In the ‘Get files (properties only)’ there’s a field ‘Order By’. The only question remains: what value it expects? It’s a similar situations as when filtering by file ‘Name’. In this case, when we want to order by a folder, you have to use the internal name for URL path.
FileRef asc
or
FileRef desc
Using the filter above, the output of the ‘Get files’ action will return all files sorted by:
- Folder level
- Alphabetically
You can see an example of the result below. Left column is sorted by FileRef ascending, right column is not sorted = default sorting by file ID.