Skip to main content

Notifications

Community site session details

Community site session details

Session Id : A82CGvjo5vOtY7XT/6qeYR
Power Automate - Building Flows
Answered

Sytnax for Odata Order By

Like (2) ShareShare
ReportReport
Posted on 7 Sep 2017 19:40:21 by 356

Is it possible to use multiple fields in the order by odata filter on a SharePoint get items action?  i.e. if I want to sort by Title Field, then Date Field as an example:

 

Title asc and Date asc

 

What is the correct way to structure that - it appears to be differen than the filter query sytax.

  • nadiaardilesc99 Profile Picture
    2 on 26 May 2022 at 20:41:34
    Re: Sytnax for Odata Order By

    Hi, thanks for your solution. I was wondering if i want to order number, power automate says this" !CKIxd!Syntax error at position 22 in 'Fecha Final_Modificada desc'. Ploc !
    inner exception: !CKIxd!Syntax error at position 22 in 'Fecha Final_Modificada desc'. Ploc !
    clientRequestId: 44c196fa-13c6-4fef-87f2-0877e196689e

  • WiggityZwiggity Profile Picture
    356 on 08 Sep 2017 at 12:14:05
    Re: Sytnax for Odata Order By

    That's awesome.  Is there a way to also apply this sorting on Unions?  i.e. if I am joining 2 arrays, and I want the combined results to sort?  the union(array1,array2) expression doesn't seem to allow for this.

  • Verified answer
    v-micsh-msft Profile Picture
    on 08 Sep 2017 at 06:41:59
    Re: Sytnax for Odata Order By

    Hi @WiggityZwiggity,

     

    The workable Sytnax for the order by should be:

    Title asc, Date asc

    Image reference:

    59.PNG

     

    The Sytnax usage is described here:

    Use OData query operations in SharePoint REST requests

    For orderby:

    "

    Use the $orderby query option to specify how to sort the items in your query return set. To sort by multiple fields, specify a comma-separated list of fields. You can also specify whether to sort the items in ascending or descending order by appending the asc or desc keyword to your query.

    "

    Regards,

    Michael

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 43

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 23 Super User 2025 Season 1

#3
Chriddle Profile Picture

Chriddle 21 Super User 2025 Season 1

Overall leaderboard