Add information from Grid Listing or List to a Collection
Hi
How do I add all the items from a List to a collection?
Thx
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Hi
How do I add all the items from a List to a collection?
Thx
Hi Deon,
You can add all the records to an array and send it:
codevar li = Appery("mobilelist_31").find("li");
var arr = new Array;
li.each(function(e){
arr.push(li[e]);
});/code
Or you can do this via mapping. You can see an example here, but you would need to map Response and Request vice versa: http://docs.appery.io/documentation/u...
Hi Katya
For the mapping. I presume you would you use the Create Service? How do you map it Visa Versa and get all the items in using $? Do I create a custom service and swop response and request?
Sorry for misunderstanding. It can't be done with mapping and code posted above is just an example. It depends on your List or Grid structure. You need to go through List/Grid and retrieve all needed values to array and save that array to DB. Saving depends on your DB structure. If you need to save into one column with array type - you will need one DB request. If you need to save into several strings (each value into a separate string) then you need to call saving service as many times as you retrieve data (each time transmitting needed data as a request data - https://getsatisfaction.com/apperyio/...)