applicationSettings not storing data


#1

Hey guys I’m trying to save some settings to be read from another page like this.

Screen 1

let selectInitObj = [
        {tapped: "user", selectedShortName: null, selectedLongName: null},
        {tapped: "start", selectedShortName: null, selectedLongName: null},
        {tapped: "end", selectedShortName: null, selectedLongName: null},
    ]
routeSelectObj = JSON.parse(applicationSettings.getString("selectObj", JSON.stringify(selectInitObj)));

Screen 2

selectObj = JSON.parse(applicationSettings.getString("selectObj", "[]"));
console.log(JSON.stringify(selectObj));    

Screen two will always return [] null

Any idea what I’m doing wrong here?

Thanks.


#2

I do not actually see where you are setting the applicationSettings for the selectobj?


#3

Hey randy I noticed my mistake after I posted. But noticed that this forum doesn’t give you the option to delete posts.

Ended up solving this issue, thanks for your help Randy!


#4

Screen 1

let selectInitObj = [
{tapped: “user”, selectedShortName: null, selectedLongName: null},
{tapped: “start”, selectedShortName: null, selectedLongName: null},
{tapped: “end”, selectedShortName: null, selectedLongName: null},
]
routeSelectObj = applicationSettings.setString(“selectObj”, JSON.stringify(selectInitObj));
Screen 2

selectObj = JSON.parse(applicationSettings.getString(“selectObj”, “[]”));
console.log(JSON.stringify(selectObj));