Expand my Community achievements bar.

Read JSON attributed in session storage Data Element

Avatar

Level 3

Hi,

In Launch have a Data element of type session Storage, when i do  _satellite.logger.log('mySessionStorageJsonObject', _satellite.getVar("mySessionStorageJsonObject")), i see an JSON object like {"userName":"John_Doe",
"region":"flooded"}.

how do i read/push the region value into another DataElement? when i do var

myJson = _satellite.getVar("mySessionStorageJsonObject") and then do var region = myJson.region or region = myJson[region] or region = myJson['region'] are all not working.

1 Reply

Avatar

Level 3

Nevermind, i figured it out. var userDetailsJsonParse = JSON.parse(myJson) did it for me;