cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

Flow: Options for sorting data

I want to sort some data (originally from a SharePoint list) in Flow.

 

I cannot sort at the 'SharePoint get items' action because I also need to filter the data by a *LookUp* field, but that is not supported by that action.

 

As a work-around to the filtering limitation, I sort in the 'Get Items' step by the ID in descending order and return the last few hundred items as the list will grow to be very long and I am concerned that if I don't specify that I only need the most recent few hundred items, I'll hit a either a hard limit on the data returned or a performance issue.

 

Once I have the most recent few hundred items, I use a Filter step (which does allow filtering on a LookUp field) to get just the records I need.

 

So now I have the data I want, but it is in the wrong order (I need to iterate through it in an Apply To Each step to build a string to be added to an email). The field that I want to sort by *is* included in the data set, I just cannot see any action I can use to sort the data inside of Flow.

 

Is there any way to sort data within Flow? Seems odd that filtering is supported but sorting is not.

 

Thanks

Paul

5 REPLIES 5
Community Support Team
Community Support Team

Re: Flow: Options for sorting data

Hi @PaulD1,

 

Please take a try to sort the data on the Get items OrderBy filter as link below:

https://powerusers.microsoft.com/t5/Building-Flows/Sytnax-for-Odata-Order-By/td-p/55185

 

Best regards,

Alice

Super User
Super User

Re: Flow: Options for sorting data

Hi Alice @v-yuazh-msft 

 

I can't do that as I am already using the Order By on the Get Items step to workaround the limitation whereby odata filters don't work on LookUp (complex) fields. As mentioned, I get around this by using the Order By to ensure I have the most recent 200 records (ordering be ID descending) as I know that will return all records I need. I then Filter those records using a Filter step (which does support filtering on LookUp fields). So I now have just the records I want, but in the wrong order.

 

Is there no way to sort records *within* Flow? Seems odd that I can filter a recordset within Flow but I cannot sort it.

 

Thanks

Paul

Community Support Team
Community Support Team

Re: Flow: Options for sorting data

Hi @PaulD1,

 

Yes, there is no any way to sort records in microsoft Flow currently.

Sorting records is not supported in microsoft flow currently.

I afraid that there is no way to achieve your needs in Microsoft Flow currently.

 

If you would like this feature to be added in Microsoft Flow, please submit an idea to Flow Ideas Forum:

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

 

 

Bes regards,

Alice

Administrator
Administrator

Re: Flow: Options for sorting data

Hello, @PaulD1!

 

Thank you for posting on the Flow Community Forum! If you have already posted your idea to the Flow Community Ideas Forum or found an existing idea to upvote, then you need to post the URL to the idea’s thread as a reply to this thread. Then click "Accept as Solution" on the reply if you approve it as a solution to your issue so that other users may vote for the Flow Idea and identify the information easily within this thread.

 

Thank You for being an active member of the Flow Community!

 

-Gabriel
Flow Community Manager

-Gabriel
Microsoft Flow Community Manager
Super User
Super User

Re: Flow: Options for sorting data

For the benefit of anyone else hitting a similar issue... I was able to filter by a complex field after all.

 

To filter a SharePoint 'Get Items' step by a complex field you can use:

Assessment/ID eq 5

Where Assessment is the name of the field and ID is one of the field attributes, eq is 'equals'.

 

Having figured out how to filter the data, I no longer needed to use 'Order By' as a workaround, so I was able to specify an 'Order By' and retrieve the data in the required sequence.

 

I still think the ability to sort data within Flow could be useful so have added that to the suggestions list.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 356 members 4,539 guests
Please welcome our newest community members: