DanGarrett
Posts: 0
Joined: Wed May 08, 2013 1:45 pm

Sort rows by posted.

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?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Sort rows by posted.

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...

DanGarrett
Posts: 0
Joined: Wed May 08, 2013 1:45 pm

Sort rows by posted.

Hi Katya,

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Sort rows by posted.

Hi Dan,

Request parameter "sort" works for us:
Image

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

DanGarrett
Posts: 0
Joined: Wed May 08, 2013 1:45 pm

Sort rows by posted.

Image

Am I missing something?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Sort rows by posted.

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".

Return to “Issues”