web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : sC3TIPOjii/a0pRX1YalqZ
Power Automate - Building Flows
Answered

Order By ODATA Value in Sharepoint Get Files (Properties Only) - Folder Name or Path

Like (0) ShareShare
ReportReport
Posted on 27 Oct 2020 19:00:33 by 17

I have a Flow that emails and HTML Table of all Files Created or Modified in all sub folders in the last 7 Days.  Flow works as designed EXCEPT, I want to order the output in the HTML table by the Sub Folder Name that houses the file, ascending order.

 

This would essentially group all the files by folder in the HTML Table.   Is it Possible to use the ODATA Orderby field to set the order of the data pulled by the folder path or folder name? 

 

Something to  the affect of "Folder Path asc"  I have tried countless variations of this and continually get errors stating the field/column doesn't exist  

 

 

SharedScreenshot - Flow 1.3.jpg

 

I have the same question (0)
  • HKEMnEEP Profile Picture
    5 on 23 Aug 2022 at 09:40:14
    Re: Order By ODATA Value in Sharepoint Get Files (Properties Only) - Folder Name or Path

    Dear Tom,

     

    Sorry for jumping into an old thread, I have exactly same question but I want to sort by the creation of date, down to second.

     

    May you shed me some light on the ODATA syntax i should use? 

     

    Many thanks in advance.

  • tom_riha Profile Picture
    10,149 Most Valuable Professional on 27 Oct 2020 at 20:42:12
    Re: Order By ODATA Value in Sharepoint Get Files (Properties Only) - Folder Name or Path

    @abm I see what you mean, it's sorting by folder levels, and you'd like to sort it by the full path. I didn't see any issue because that's the sorting I expected.

  • abm abm Profile Picture
    32,506 Most Valuable Professional on 27 Oct 2020 at 20:22:49
    Re: Order By ODATA Value in Sharepoint Get Files (Properties Only) - Folder Name or Path

    Hi @tom_riha 

     

    Thanks for your reply.  Please see below.

     

     

    image.png

     

    Here aj is my library, x1 and a are the folders

     

    The other question you asked about internal fields name. Here it is.

     

    https://dipansaha.wordpress.com/2012/07/23/useful-reference-for-sharepoint-internal-fields-name/

     

  • tom_riha Profile Picture
    10,149 Most Valuable Professional on 27 Oct 2020 at 20:14:53
    Re: Order By ODATA Value in Sharepoint Get Files (Properties Only) - Folder Name or Path

    @abm To me it looks fine, why do you think it's not working? Left side is using Order By = FileRef asc, right side doesn't have any Order By = sorted by defaut by ID?

    image.png

    @STLMDV for example here: https://dipansaha.wordpress.com/2012/07/23/useful-reference-for-sharepoint-internal-fields-name/

  • STLMDV Profile Picture
    17 on 27 Oct 2020 at 20:07:40
    Re: Order By ODATA Value in Sharepoint Get Files (Properties Only) - Folder Name or Path

    Thank you so much, that did!

     

    By Chance, do you know of link, document or method to lists these hidden columns?

  • abm abm Profile Picture
    32,506 Most Valuable Professional on 27 Oct 2020 at 20:06:09
    Re: Order By ODATA Value in Sharepoint Get Files (Properties Only) - Folder Name or Path

    Hi @STLMDV  & @tom_riha 

     

    I just tried couple of options including the FileRef and it didn't worked as expected.  Initially I thought I could utilise FullPath which is the folder path but Filter Query only accepts a valid columns names.

     

    Sorting array would have been a good option here but you could vote for this idea.

     

    https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Sort-Array/idc-p/486807#

     

    Unfortunately you won't be able to do this via Power Automate Sort Order property.

     

    You have couple of options:

     

    Write a custom function and execute via HTTP but you need some dev effort to achieve this.

     

    Other option is please below link it explains how to sort some numeric values. 

     

    http://johnliu.net/blog/2018/12/how-to-implement-sort-with-microsoft-flow-in-3-actions-within-a-loop

     

     

  • Verified answer
    tom_riha Profile Picture
    10,149 Most Valuable Professional on 27 Oct 2020 at 19:54:01
    Re: Order By ODATA Value in Sharepoint Get Files (Properties Only) - Folder Name or Path

    There are some hidden columns for the documents in SharePoint, among them 'FileRef', which contains the whole file path including file name. You can use that in the Order By, just put there:

     

    FileRef asc

     

    and it'll sort the result by folder(s), subfolder(s) and file name.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 786 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 724 Super User 2025 Season 2

#3
stampcoin Profile Picture

stampcoin 290 Super User 2025 Season 2

Last 30 days Overall leaderboard
Loading complete