Hi, I could use some help in saving data. I’m trying to figure out a way to save data between scans of a Zapcode. My issue I’m running into is the syntax.
This creates the array in the first time the experience is ran.
Z.RequiresVersion.v440;
export var spots;
export var areas;
Z.device.retrieve("userdata", function (data) {
if(data !==undefined)
{
var score = new Array (12);
Z.device.store("userdata",{
score:[false,false,false,false,false,false,false,false,false,false,false,false]
})
}
For me to retrieve saved data, I know I can into score but I’m not sure how to. The function below will modify the array with new data, turning the element into true, when seen but I’m not sure how to access the array. Every type of syntax I try post a error. Is there something special for access that array?
export function TargetIsSeen(token)
{
Z.device.store("userdata",{
//retrieve data and modify experience based on data
})
}
Is there syntax to access a array in the saved data?
Thanks!