Page 1 of 2

How to get count in query response

Posted: Sat Jan 04, 2014 12:20 pm
by Don Schueler

I see how to add the count = 1 parm to the query to get a count of the rows in my query but when I add the count variable in the response and map it I get "undefined" returned to the COUNT in the control. What am I missing? Count comes back in the JSON response in TEST fine.


How to get count in query response

Posted: Sat Jan 04, 2014 12:39 pm
by Illya Stepanov

Hi Don,

Can you show how you store the count variable and example of test response?


How to get count in query response

Posted: Sat Jan 04, 2014 5:44 pm
by Don Schueler

I am not storing it in a variable...it just comes back in the response and I try to map that result to a COUNT on a collapsible list..shouldn't that work?


How to get count in query response

Posted: Sat Jan 04, 2014 8:48 pm
by maxkatz

Does it work when you test the service?


How to get count in query response

Posted: Sat Jan 04, 2014 8:58 pm
by Don Schueler

yes, I see the value returned


How to get count in query response

Posted: Sat Jan 04, 2014 9:00 pm
by maxkatz

But when you bind the value to a component on a page -- you get nothing?


How to get count in query response

Posted: Sat Jan 04, 2014 9:14 pm
by Don Schueler

here are screenshots...is this the right way to bind the count? Image


How to get count in query response

Posted: Sun Jan 05, 2014 12:36 am
by Alena Prykhodko

How to get count in query response

Posted: Sun Jan 05, 2014 5:48 am
by maxkatz

Also, the JSON structure that you get back from a test doesn't seem to match the service response structure that you have in mapping. It looks like you are mapping a collection.


How to get count in query response

Posted: Sun Jan 05, 2014 3:43 pm
by Don Schueler

I did add the count var both inside the collection as well as outside of it and the result was the same. Image