update

Apperyio.storage.variableName.update(path, value)

Updates specified storage variable by provided path with a specified value.

Parameters summary

The method has the following parameter(s):

ParameterDescriptionRequired
pathPath in form of a Mapping Expression to value that should be updated.Yes.
valueNew value.Yes.
Examples

Let's say a storage variable Product holds the following data:

{"partNumber": 1000, "name": "Smartphone"}
The following code will update the name field:

Apperyio.storage.Product.update("$['name']", "Smart Watch");
var p = Apperyio.storage.Product.get();
console.log(p);
{name: "Smart Watch", partNumber: 1000}
Here is another example but this time using a variable:
var fieldName = "name";
Apperyio.storage.Product.update("$['"+fieldName+"']", "Smart Watch");
var p = Apperyio.storage.Product.get();
console.log(p);
{name: "Smart Watch", partNumber: 1000}