Access and Change Array in Saved data

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.


export var spots;
export var areas;

Z.device.retrieve("userdata", function (data) {
    if(data !==undefined)
        var score = new Array (12);"userdata",{


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)
     //retrieve data and modify experience based on data

Is there syntax to access a array in the saved data?


Id like to get some help with storing and retrieving data also!
Have already checked Studio | Storing Persistent Data
But that didnt help me so much since im not programmer. I tried and tried but didnt found any solution

My problem is how to store and retrieve high scores beetween scans (Im using webAR)

My code looks like this, tutorials did help me very much! Thank you everyone for that.

const Score = symbol.nodes.Score;
const Scoreboard = symbol.nodes.Scoreboard;

let score = 0;
let scoreIncrement = 1;
let minusScore = 1;

// This function adds score
function add(){
    score += scoreIncrement;

// This function is minus score
function minus(){
    score -= minusScore;

//this pointerdown event call add-functiion
symbol.nodes.Pointer.on("pointerdown", (e) => {

//this pointerdown event call minus-function
symbol.nodes.Minuspointer.on("pointerdown", (e) => {

symbol.nodes.SaveyourScore.on("pointerdown", (e) => {"Points", score);

symbol.nodes.SaveyourScore.on("pointerdown", (e) => {
    Z.device.retrieve("Points", function(data){
    if (data == undefined){
    //nothing happes
    } else {
    //call your score


1 Like