sdanigo
Posts: 0
Joined: Sat Jun 06, 2015 8:50 pm

rest service sort option

Hi,
Made a rest servive with Api Express,
in my app, created in the request parameter (query) a sort parametr (named sort) whith value 'ordre' (without quote, which is a field of my database).

No effects.

Is there something wrong ?

Thanks

Sylvain

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

rest service sort option

Hello Sylvain,

Unfortunately it is not clear enough. Could you please provide more details, screen shots would also help.

sdanigo
Posts: 0
Joined: Sat Jun 06, 2015 8:50 pm

rest service sort option

Hi,
some screen shots:

Image
Image

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

rest service sort option

Please send us more screenthots (servise's settings tab, test tab)

Also provide us with a public app link(http://devcenter.appery.io/documentat...) and steps to reproduce.

Andrew Main
Posts: 0
Joined: Tue Jun 16, 2015 12:19 pm

rest service sort option

I have a similar issue using API express. Link to my original post: https://getsatisfaction.com/apperyio/...

basically i've add &sort=created_at at the end of my REST url request, however nothing happens.

I have also tested it and I can get it to work correctly for imported database services, but I can not get it to work for API express services as the two images below show

Trying various different fields and with and without the '-' I was not able to get the results to change in any way with a sort parameter.
Image

This one worked no problems

Image

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

rest service sort option

Andrew,

For now sorting based on ID is only allowed.
We are planning to add such ability for custom fields, but can not say any time frames.

Andrew Main
Posts: 0
Joined: Tue Jun 16, 2015 12:19 pm

rest service sort option

Can i sort in reverse by IDs? So i can show the 100 most recent items?

leven.steve
Posts: 0
Joined: Sun Mar 04, 2012 4:01 pm

rest service sort option

Has the sort and limit defaults changed?
I'm using query service with sort=xxx and it's only returning 100 records

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

rest service sort option

Hello,

Yes. There is a default limit parameter which equals 100. That means that only 100 records will be returned if other wasn’t specified. To avoid this limitation, use the limit parameter https://devcenter.appery.io/documenta... in the requests and specify your own value. Max value is 1500.

leven.steve
Posts: 0
Joined: Sun Mar 04, 2012 4:01 pm

rest service sort option

This code still returns only the first 100 items. Have I added the parameter correctly?

codevar requestData = {};
requestData = (function mapping3415($scope){
var requestData = {};
requestData.params = Apperyio.EntityAPI('DB_Rates_query_service.request.query', undefined, true);

Code: Select all

 requestData.params.sort = "Name&quot 
 requestData.params.limit = 200; 

 return requestData;/code

Return to “Issues”