Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Solution
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

How to order SharePoint items returned by ‘Get items’ in Power Automate

Posted on May 12, 2021May 12, 2021 by Tom

“Is it possible to use multiple fields in the ‘Order By’ Power Automate OData filter on a SharePoint ‘Get items’ action?  i.e. sort by Title and Date field?”


Power Automate action ‘Get items’ will always return the SharePoint items in an order, by default ascending by ID – the oldest items first. In most situations the order doesn’t really matter, but there’re some cases when it does. For example, if you export the SharePoint list items into an HTML table, it makes sense to sort it differently. It’s always easier to read an export if you group the related items together, e.g. requests for a specific user.

Since Power Automate doesn’t have an action to sort an array later, you should sort the results right away. There’s a workaround to sort an array, but with SharePoint items it’s an extra work. If you can sort the items directly in ‘Get items’, you should do it.

‘Order By’ format

The expected format of the ‘Order By’ field is very simple. Type in the SharePoint column internal name and the order: asc for ascending or desc for descending.

e.g. ascending by Title
Title asc
Order SharePoint items in Power Automate

If one column is not enough, you can order by multiple columns, just separate the columns and order by a comma. The sorting priority will be from the left to the right.

e.g. ascending by Title, then descending by DateTime
Title asc, DateTime desc
Order SharePoint items Power Automate by multiple columns

Summary

As already mentioned, if you need to sort the items, you should do it right away. The ‘Get items’ action gives you the possibility in the ‘Order By’ field – just define the columns and their sorting order.

And if you’d like to filter the items before that, take a look on the filtering section on the blog.


πŸš€ Master Power Automate

Join 2,100+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

10 thoughts on “How to order SharePoint items returned by ‘Get items’ in Power Automate”

  1. Mike says:
    April 29, 2022 at 10:10 pm

    Hi

    Have you tried looping through the ordered get items. If I use apply to each based on the get items order by, in my case asc, the order is not in really in ascending order. It might start with A’s and B’s but then jumps to W and then back B etc – thanks

    Reply
    1. Tom says:
      May 3, 2022 at 8:09 pm

      Hello Mike,
      I didn’t notice anything like that, did you try adding ‘Select’ to select only the sort property to confirm the order? I can imagine it could happen also if you used some level of parallelism in the ‘Apply to each’ that some items would be processed faster than others.
      But if that’s really broken then I’m afraid there’s no other easy way how to sort the returned items.

      Reply
  2. Zoe says:
    June 12, 2022 at 7:30 pm

    Hi

    Thank you very much. I found this website is very useful.
    I want to order a list by a lookup value. The way I tried was to use get item/order by/use the lookup field name in the address ( everything after ‘Field=’). However the system told me the field name can not be found. is there other way to use lookup value to order a list? thank you

    Reply
    1. Tom says:
      June 19, 2022 at 9:50 am

      Hello Zoe,
      there’re the same rules as when filtering using the lookup columns. You must use the internal name + by which value it should sort, e.g.
      Lookup/Id asc = ascending by Id in the lookup list
      Lookup/Title desc = descending by the displayed value from the lookup list

      Reply
  3. Nancy Dubeau says:
    October 24, 2022 at 10:45 pm

    Hi there, my field is a value, in the code the field name is Status_x003a_/Value. I have tried a variety of configurations and cannot figure out how to get this value work with the desc appended.

    Simple field names like: RequestDate are no issue

    What am I missing?
    Is there an expression I need to turn it into?

    Reply
    1. Tom says:
      October 31, 2022 at 6:45 pm

      Hello Nancy,
      I’d double check the column internal name (https://tomriha.com/what-is-sharepoint-column-internal-name-and-where-to-find-it/), I don’t think / is a supported character for that.

      Reply
    2. Tamara says:
      February 23, 2023 at 5:15 pm

      Hi Nancy, I’m sure you’ve long figured this out but for me I had to remove the “/Value” part from the lookup field name for the Order By to work.

      Reply
  4. Brendan says:
    February 1, 2023 at 2:59 am

    Thanks for this.
    Wanted to filter my list down to see if a checklist was completed for the day and if not, email everyone.

    Works well.

    Reply
  5. Deanna says:
    February 29, 2024 at 7:09 pm

    Thank you – exactly what I needed for sorting on more than one field.

    Reply
  6. Rae says:
    August 19, 2024 at 7:17 pm

    That is the opposite of “ID asc ” tried everything and I get responses back like “Action ‘Get_items_1’ failed: The field ‘field_7’ of type ‘Note’ cannot be used in the query sort expression”
    or
    “ID desc ” tried everything and I get responses back like “Action ‘Get_items_1’ failed: The API ‘sharepointonline’ returned an invalid response for workflow operation ‘Get_items_1’ of type ‘OpenApiConnection’. Error details: ‘The API operation ‘GetItems’ is missing required property ‘body/value/3/field_7’.'”

    sometimes it wants column name or field name. Its really quiet buggy?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

πŸš€ Master Power Automate

Join 2,100+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Still exchanging emails to get things approved?

Get the Approval Process solution and the Task Delegation App to skip the hard part and deploy an automated, fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes