maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to get count in query response

This is the correct response for the service to get a count:

Image

Is that what you have? I think looking at your mapping, the 'count' is on the same level as $.

Shawn
Posts: 0
Joined: Sat Jun 21, 2014 11:13 pm

How to get count in query response

hi

I'm facing a similar challenge to get count back from a query.
I'm trying to implement pagination and need count of my query results.

The pagination example
http://devcenter.appery.io/tutorials/...

states 'For example: run a service to count how many objects there are.'

How do I implement this ?

Rgds
Shawn

Shawn
Posts: 0
Joined: Sat Jun 21, 2014 11:13 pm

How to get count in query response

Further to this if I add a count parameter to the Request I only get the count variable and not the Query set itself.

I would like to get the count of my query to use in pagination and the results as well to render on my page.

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

How to get count in query response

Hi Shawn,

There should be the following service response if you use a request parameter count=1.
Image

Shawn
Posts: 0
Joined: Sat Jun 21, 2014 11:13 pm

How to get count in query response

If I add count = 1 in the request parameters of the main query then I only get the count variable but not the result set

Do I need to add a new service only for the count ?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

How to get count in query response

Hi Shown,

If the response is "count = 1" you'll get in return only count the items will not be included.

Return to “Issues”