Page 1 of 2

Service execute on each list item

Posted: Fri Oct 09, 2015 4:14 am
by Jack Bua

in a JQM app, I have a list service that populates a list. For each list item, I would like to use that item's ID in a where clause for a service that is invoked. The second service will be used to retrieve all records related to each item in the list and sum a field in that list.

For example I have a list with 4 items, and each item has 5 "child" records (records that have its id in them) in another table, each with the value of 1 in the field I want to sum. The end result of what I am trying to do here is to display that sum, in this case 5, in each list item.

Image

I know this must be possible and would fall as custom JS logic, but I have spent days worth of hours trying to get there myself and am totally lost. Could someone just point me in the right direction please?


Service execute on each list item

Posted: Fri Oct 09, 2015 6:42 pm
by Serhii Kulibaba

Hello Jack,

Do you use pointers for that? If so you can get all items by only one request and sum all necessary items via JS,


Service execute on each list item

Posted: Fri Oct 09, 2015 7:18 pm
by Jack Bua

Yes I use pointers but I cannot see how that can help. I am not summing when dealing with the child values. I am summing with dealing with the parent values. To the best of my understanding, pointers only help point upwards in the structure.

What I am showing you in that mock screenshot is the list of parent values. for each value I want to run a service that looks at another collection and sums up all the values that point to the parent.

For example, using the mock screenshot I included above, for record A (second black box), I want to grab its ID (first black box) and search a separate collection for every record that has that ID in a pointer column, then display the results on that list item (in the red box). I then want to do that for record B and every other record.

I just need to know the code to put on the list item or the populating service to do that.


Service execute on each list item

Posted: Sat Oct 10, 2015 1:59 pm
by Serhii Kulibaba

We are very sorry, but custom code is something outside the scope (http://devcenter.appery.io/support-po...) of our support.


Service execute on each list item

Posted: Sat Oct 10, 2015 8:18 pm
by Jack Bua

I figured as much. This is very important for me to learn so I figured to ask anyways in hopes of an employee feeling generous or another community member being willing to share some of their knowledge.


Service execute on each list item

Posted: Sun Nov 01, 2015 9:32 am
by Jack Bua

I would be willing to pay someone to get over this hurdle. If anyone knows they can answer this, please let me know.


Service execute on each list item

Posted: Fri Nov 27, 2015 10:19 pm
by Jack Bua

I relearned of my need for something like this. I am surprised that a need for this is not more common, so either a tutorial or documentation on this would be sorely needed, or I am searching for the wrong terms and the answer for what I seek is out there still.

Could someone point me in the right direction?


Service execute on each list item

Posted: Mon Nov 30, 2015 8:39 pm
by Serhii Kulibaba

Please run service on the each item via JS: https://devcenter.appery.io/documenta...


Service execute on each list item

Posted: Mon Nov 30, 2015 9:06 pm
by Jack Bua

I tried that before, but passing a where parameter along with the service execute and manipulating the data (counting and summing it) on success of the service seemed to be too difficult for me. If my memory serves me, I was only to get a limited test using this setup to fire the execute once, and that was for the first item in the list.


Service execute on each list item

Posted: Tue Dec 01, 2015 7:13 pm
by Serhii Kulibaba

There are no solutions. Please review your DB struncture if it is not acceptable to you