Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

list all items of a collection in specific order

I need to return all items from a collection in a particular order. I don't think this can be done with a list service, so i am guessing it has to be done in a query service.

I wish to order my collection by 'Tax_Period' which is a string like '2015-2016' or '2016-2017'. I want them listed in ascending order, how would I do that ?

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

list all items of a collection in specific order

Hi Terry,

Add a parameter to the query service callled 'sort' ( it's on the same page as the where parameter ) , and then specify 'Tax_Period' ....

You can change from Ascending to descending by using a '-' in front of the Column name.

You can of course test this in the service using the test tab.

Best,
Bruce

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

list all items of a collection in specific order

And Happy Monday !

Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

list all items of a collection in specific order

Thanks, Bruce,

i just realised i can also add it to the list service, therefore no need to change to a query service. Works fine!

Happy Monday!

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

list all items of a collection in specific order

Sweet ! That makes great sense ... good luck with today's challenges !

Return to “Issues”