Hi Deon,
Here is a code to get items from a storage and copy it to another storage with some condition.
pre
//var originalArray = [{id: 1}, {id: 2}, {id: 3}];
//Getting original Array from the storage.
var originalArray = Apperyio.storage.originalArray.get();
var resultArray = [];
for(var i = 0; i < originalArray.length; i++){
Code: Select all
//Condition how you want to filter items. Only items that satisfies this condition - will be added to result array.
if(originalArray[i].id 1)
resultArray.push(originalArray[i]);
}
//Store result in a storage.
Apperyio.storage.resultArray.set(resultArray);
/pre
Regards.