cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

SharePoint Query list action does not sort?

How to obtain a sorted item list from a SharePoint Query List action?

I have certain recipes and each recipe has a priority (integer value). I simply need to have the recipe with the highest priority on top when I start looping through the result set using a For Each action:

2020-11-17_17-57-12.png

I expected the sort option in the Query List action. But not. It is also not in the For Each action. And the Sort a Collection action will not sort a collection of items. Sorting also doesn't take place in defining the data connection so I am running out of options.

What did I miss?

Labels: (1)
0 Kudos
Reply
3 Replies
Highlighted
Nintex Employee
Nintex Employee

Re: SharePoint Query list action does not sort?

@woutert What is the range of priority you are dealing with,  i'm thinking you might need to use logic inside of a for each to build out a collection that has the item ID's in the order you would like.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: SharePoint Query list action does not sort?

@leighburke Thanks for the reply!

 

This list of recipes will grow until probably 40 or 50 items. It has been decades ago that I programmed a manual bubble-sort algorithm :) Not looking forward to that.

 

I need to loop through the recipes from priority high to low and as soon as I find a recipe that fits the requirements (=max. 4 parameters) I quit the For Each and pass the ID on to the next part of the workflow. There might be multiple recipes fitting the requirement parameters so I need to honor the highest priority which sets the rule for which recipe prevails over another.

 

I have created a funny workaround now using a NW365 site workflow that creates every day a new list of RecipeID's in the right order in a separate list.

2020-11-26_15-42-53.png

The For Each in NWC goes on this list first.

A bit ugly but works for now.

I really miss the sorting in the Query List action. I have used it so often on NW4SP and NW365.

 

0 Kudos
Reply
Highlighted
Nintex Employee
Nintex Employee

Re: SharePoint Query list action does not sort?

@woutert Glad you got something working. I will certainly raise the adding sorting options.

Reply