Page 1 of 1

Save Array to Storage and Get Array Value from Storage

Posted: Mon Jan 25, 2016 3:14 am
by Jack Bua

I have a mapping from a service to a label in a list. For each list item, I want to look at a separate collection filtered by the id of each list item and sum that "sub-list"

Here is the mapping:

Image

And here is the code on that mapping:

var token = Apperyio.storage.user_session_token.get();
var jli = value._id;
var sum = 0;
var mins = 0;

var whereObject = {job_lineitem_ptr: {"$inQuery": {_id: jli } } };

var onSuccess = function(data){
Apperyio.storage.time_logs.set(data);
console.log(Apperyio.storage.time_logs.get());
console.log(Apperyio.storage.storageVariable.get("$['time_logs']['minutes']"));
};

view_lineitems_actual_hours_calc.execute({
headers: { "X-Appery-Database-Id": "DATABASE STRING" , "X-Appery-Session-Token": token } ,
data: {"where": JSON.stringify(whereObject)} ,
success: onSuccess
});

for (var i=0; iImage


Save Array to Storage and Get Array Value from Storage

Posted: Mon Jan 25, 2016 7:06 am
by Jack Bua

After taking a step back and approaching this issue from another direction, I have modified my code. As such, this title is not really accurate anymore. I have created a new post regarding the issue here:

https://getsatisfaction.com/apperyio/...


Save Array to Storage and Get Array Value from Storage

Posted: Mon Jan 25, 2016 4:00 pm
by Serhii Kulibaba

Answered in the topic above