SharePoint list default order

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

Posted On May 12, 2021

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 doesnt really matter, but therere 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. Its always easier to read an export if you group the related items together, e.g. requests for a specific user.

Since Power Automate doesnt have an action to sort an array later, you should sort the results right away. Theres a workaround to sort an array, but with SharePoint items its 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

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

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 youd like to filter the items before that, take a look on the filtering section on the blog.

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

First Name

Email address

Zero spam, unsubscribe anytime.

Leave this field empty if youre human:

Add a Comment

Cancel reply

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

Save my name, email, and website in this browser for the next time I comment.

Δ

Video liên quan

Chủ Đề