Page 1 of 1

Show new database entries first in the list

Posted: Sun Dec 14, 2014 1:59 pm
by Louay Ali

Hi,

I would like to know how to display the newest additions ( rows ) to the database the first thing in the list. To be acting like a stack not a queue.

Thanks.


Show new database entries first in the list

Posted: Mon Dec 15, 2014 3:46 am
by Yurii Orishchuk

Hi Louay,

You need to use "sort" parameter with value "_updatedAt".
Details: http://prntscr.com/5gz868/direct

More details about sorting here: http://devcenter.appery.io/documentat...

Regards.


Show new database entries first in the list

Posted: Mon Dec 22, 2014 12:28 pm
by Louay Ali

Ok, that works fine if i am using the Test feature in the service itself.

How can i apply that on the database of the app itself ?


Show new database entries first in the list

Posted: Tue Dec 23, 2014 12:11 am
by Yurii Orishchuk

Hi Loyay,

You need to:

  1. Add service datasource on the page.

  2. Click "Before send" mapping.

  3. In request "sort" put value "_updatedAt".

    Okay from this time when you will invoke this server datasource it will send this sort parameter.
    Details: http://prntscr.com/5jwqzh/direct

    Regards.


Show new database entries first in the list

Posted: Tue Dec 23, 2014 9:23 am
by Louay Ali

Hi Yurii, Thanks for your help.

I did what you said, but it doesn't yet work. If i clicked : "Test" from inside the service, it works fine, but it doesnt work on the screen itself when the service is invoked on page show.

Any more help ?


Show new database entries first in the list

Posted: Tue Dec 23, 2014 12:45 pm
by Evgene Karachevtsev

Hello!

1) If it doesn't work in the tester, then you have made a mistake somewhere in the mapping, or there was an error on the page
2) Could you please show us the mapping for your service?
3) Also please open the console before launching the service to see coming error.


Show new database entries first in the list

Posted: Tue Dec 23, 2014 1:23 pm
by Louay Ali

Hi,

There are no errors in the page. The Data is show but on the old format which is by default ascendingly. The new mapping ( descending order ) doesn't yet show on multiple devices even.

Image


Show new database entries first in the list

Posted: Tue Dec 23, 2014 11:15 pm
by Yurii Orishchuk

Hi Louay,

Your mapping seems to be correct.

Please show us your app public link and describe steps to reproduce this problem.

Regards.