Page 1 of 4

Sorting database results from a service

Posted: Tue Mar 19, 2013 9:44 pm
by David Andrews

I am having trouble figuring out how to add a sort parameter to a database service using the services in Tiggzi. I have tried adding a new parameter with this

Parameter Name (-G --data-urlencode)
Default Value ('sort=number')

I get the results but they are not sorted by the column "number"
I'm guessing I'm doing it all wrong. Any help would be appreciated.


Sorting database results from a service

Posted: Tue Mar 19, 2013 9:48 pm
by Maryna Brodina

Sorting database results from a service

Posted: Tue Mar 19, 2013 9:54 pm
by David Andrews

That's where I got the information I used for the above method. It doesn't really help me understand how to use those parameters using your fill in the blanks "service builder" to accomplish the same task.


Sorting database results from a service

Posted: Wed Mar 20, 2013 2:19 pm
by Kateryna Grynko

Hi David,

To sort data received from database you would need to add Request parameter "sort" that has a collection column name as a value (case sensitive).

If you access database via CURL you should use the following argument:

--data-urlencode "sort=number"


Sorting database results from a service

Posted: Wed Mar 20, 2013 3:34 pm
by David Andrews

Ok, Thanks! I see now and I got it to work.


Sorting database results from a service

Posted: Mon May 19, 2014 12:10 am
by RobertJay

Hi Katya, my collection has numbers but in string format. Is there any way of forcing a numeric sort with such columns ... or will I have to re-import the database with those columns as numbers? Thanks.


Sorting database results from a service

Posted: Mon May 19, 2014 7:42 am
by Evgene Karachevtsev

Hello Robert,

if you want sort you field as number you shoud have type of this field as "number".


Sorting database results from a service

Posted: Wed Jul 09, 2014 10:02 pm
by Oliver Fisk

How can I sort alphabetically on text fields?
How can I sort dates?


Sorting database results from a service

Posted: Thu Jul 10, 2014 10:40 am
by Kateryna Grynko

Hi Oliver,

You can use parameter "sort": http://devcenter.appery.io/documentat...


Sorting database results from a service

Posted: Fri Aug 01, 2014 4:40 pm
by Alex GG

Hi Katya,

In my data base I have like 20 records,

When I do a list service of those records, the order shown is not the same as in the data base. For example, If I add a new record in the DB, when I test the app, that new record appears in 14th place. I know that I can add a new column and then do a query using "sort", but in the meantime, what can I do so the new added record is the first shown in preview?

Regards