How to order response array in a REST service? (Hacklondon20

Posted by andrew.p.moss@bt.com on 18-Jun-2014 04:44

I have a REST service that queries a Rollbase Mobile DB (e.g. at https://mobile.rollbase.com/database/)

How can I add a request parameter to order the results?

Posted by Anil Kumar on 18-Jun-2014 05:44

Hi Andrew,
 
If you are looking for an example for sorting the records like ascending and descending you can place ‘sort’ attribute in the request parameter as follows:
 

1.       Add the request attribute by the name sort

 
 

2.       For displaying the records in Ascending Order use the direct field name as the value for the sort attribute

 
 

3.       For displaying the records in descending order add – before the field name as the value for the sort attribute

 
 
 
We can also sort the records with multiple fields with comma separated values for the sort attribute.
 
Thanks and Regards,
Anil Kumar.
 
[collapse]
From: andrew.p.moss@bt.com [mailto:bounce-andrewpmossbtcom@community.progress.com]
Sent: Wednesday, June 18, 2014 3:40 PM
To: TU.Rollbase@community.progress.com
Subject: RE: [Technical Users - Rollbase] How to order response array in a REST service? (Hacklondon2014) - Rollbase Mobile
 
RE: How to order response array in a REST service? (Hacklondon2014) - Rollbase Mobile
Reply by andrew.p.moss@bt.com

Yes, I know how to user the services and am using it by creating a new Database Service. My question was how do I add a request parameter to change the ordering of the rows returned from the database?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

All Replies

Posted by Anil Kumar on 18-Jun-2014 05:02

Hi Andrew,
 
Everything in the Rollbase Mobile database is automatically exposed via RESTful APIs, so one can define the service by entering its URL, and defining request/response parameters. The other simpler approach is to use Database services.
                Create New -> Database Services
 
A detailed example/tutorial is available in following location:
 
 
Hope this helps.
 
Thanks and Regards,
Anil Kumar.
 

Posted by andrew.p.moss@bt.com on 18-Jun-2014 05:09

Yes, I know how to use the services and am using it by creating a new Database Service. My question was how do I add a request parameter to change the ordering of the rows returned from the database?

Posted by Anil Kumar on 18-Jun-2014 05:44

Hi Andrew,
 
If you are looking for an example for sorting the records like ascending and descending you can place ‘sort’ attribute in the request parameter as follows:
 

1.       Add the request attribute by the name sort

 
 

2.       For displaying the records in Ascending Order use the direct field name as the value for the sort attribute

 
 

3.       For displaying the records in descending order add – before the field name as the value for the sort attribute

 
 
 
We can also sort the records with multiple fields with comma separated values for the sort attribute.
 
Thanks and Regards,
Anil Kumar.
 
[collapse]
From: andrew.p.moss@bt.com [mailto:bounce-andrewpmossbtcom@community.progress.com]
Sent: Wednesday, June 18, 2014 3:40 PM
To: TU.Rollbase@community.progress.com
Subject: RE: [Technical Users - Rollbase] How to order response array in a REST service? (Hacklondon2014) - Rollbase Mobile
 
RE: How to order response array in a REST service? (Hacklondon2014) - Rollbase Mobile
Reply by andrew.p.moss@bt.com

Yes, I know how to user the services and am using it by creating a new Database Service. My question was how do I add a request parameter to change the ordering of the rows returned from the database?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

This thread is closed