Jakub,
We are working on it and we'll get back to you with the update.
Jakub,
We are working on it and we'll get back to you with the update.
Hi Jakub 
 This is how I solved this...
But instead of saving the cart array to DB, Im sending this to my email (using sendgrid). In that way I dont need to check DB now and then, I just receive a notification from Gmail App...
Just do a loop in your cart and save every item to a string...then send it either your DB or an email...
Ok, Thanks. that is where I was heading too. But now how do you invoke the REST Service POST with the string?
I am not sure what you mean by "Create database". I have a REST service that posts into my DB (not Aperio db). In the screen capture above you are creating the loop on one of the REST service Request fields and saving all fields from the string?
In the image below is my service request. It is linked to the cart at the moment and inserts the first record only. Are you saying that I should select one of those fileds and loop through the cart array and post the string? 
  
 
Ok, I guess you where using appery DB.
Yes you are right, try removing all links...and select one field on the right side, and loop through the cart array, and the use "return"
when you use Apperyio.storage.cart.get() you dont need any link, because you are reading from storage...
Of course, you are going to receive all the cart items as an string in that particular field of your database,,,if this is not what you want, you should try other way,,,
I understand that, but I am thinking that if I loop and return the entire cart string into one Request field of the Service, the entire string will get posted into THAT field in the database, no? 
 I need each field in the cart posted in the corresponding field in the service/database
you ́re right,,then you need to try the other way...
Hope Appery team help you with that..
What is the "other way"? ![]()
I would suspect that this must be a very common scenario.  
 Have a shopping cart (list of items) and post them back to backend database.
Appery.io should be able to handle it "out of the box".
Is there a solution?
Thanks
Ok, I am trying to address it from the "other way" 
 I am invoking the service from JS (see below)
But it throws error even when I hardcode the JSON data. What is the proper format to submit for a POST?
Code: Select all
// Get cart 
 var cart = Apperyio.storage.cart.get() || []; 
 var KitID= Apperyio.storage.KitID.get(); 
 var text=""; 
     //Loop through all cart items 
     for (var i = 0; i < cart.length; i++) 
     { 
         var currItem = cart[i]; 
         text='{"Kit_ID":' + KitID + ',"method_id":' + cart[i].id + ',"Matrix":' + cart[i].Matrix + '}'; 
         alert(text); 
                     svcPostKitdetail.execute({ 
             data:{"Kit_ID":19,"Method_ID":549},                                        
             headers:{} 
         }); 
       //       svcPostKitdetail.execute({ 
       //  data:{"'Kit_ID":KitID,"method_id":cart[i].id,"Matrix":cart[i].Matrix },       
       //  headers:{} 
    // }); 
     }