Page 1 of 1

Sort rows by posted.

Posted: Thu May 16, 2013 6:01 am
by DanGarrett

Hey Guys,

I have a system posting into a database but I want to be able to pull rows from the DB in a different order, like by date/time.

Basically to use the data organised from newest to oldest.

Any ideas?


Sort rows by posted.

Posted: Thu May 16, 2013 6:37 am
by Kateryna Grynko

Hi Dan,

To sort rows you would need to add request parameter "sort". As a value use the name of the column you want to sort by.
This should be helpful: http://docs.appery.io/documentation/b...


Sort rows by posted.

Posted: Thu May 16, 2013 6:46 am
by DanGarrett

Hi Katya,

I've added the request paramater "sort" and the value as "_createdAt" but it makes no changes to the result.


Sort rows by posted.

Posted: Thu May 16, 2013 7:34 am
by Kateryna Grynko

Hi Dan,

Request parameter "sort" works for us:
Image

If you need descending sorting then in parameter sort add minus sign:
"-_createdAt"


Sort rows by posted.

Posted: Thu May 16, 2013 7:37 am
by DanGarrett

Image

Am I missing something?


Sort rows by posted.

Posted: Thu May 16, 2013 8:03 am
by Kateryna Grynko

Please check the data output on the collection management page. For the output of the list from newest to oldest you don't need "minus" before the column nameThat is, sort: "_createdAt".