How can I count specific values from a DB to show them in the app? I need to check in my DB if some value is 'yes' or 'not' and them show in the app the total number of values that are equals to yes and the ones that are not.
(I have the same question)
I understand that you can use these parameters but how do you return the count to a local storage variable or to a label so that it can be used in the app?
When creating a mapping, you should specify where to save a result.
You can either save it in a component (in your case it is a label), or in a local storage variable (then you should create this variable in 'model and storage' section beforehand).
I have tried to specify where to save the result but I can not seem to find where to do that. I have uploaded pictures. The first one is of the before send on the query where I can specify the count. The second one is the mapping of the success but there is not an option to map the count to anything.
To get count of returned service items you can:
1 Add "Success" event handler for service.
2 Populate it with following code:
//Get items count.
var count = data.count;
//Save count to LSV.
After you can get "lsvName" lsv where you need with following code:
var count = localStorage.setItem("lsvName", count);
I tried doing what you have suggested but for some reason when I add the count parameter my queries stop working. It messes up all of my other queries that were previously working. Once I remove the count parameter the other queries begin to work again.
"Count" service should be implemented as separate service.
1 Delete "count" parameter from the service.
2 Duplicate this service. http://prntscr.com/4xukgb/direct
3 Rename new(clone) service as you need.
4 Open this service and add "count" parameter.
5 Use this new service where you need to get count.
6 Use old service where you need to get list.