Page 1 of 1

Get and Set multi level storage model Values using Javascript

Posted: Thu Jul 16, 2015 4:34 pm
by Pete Nellmapius

I have the following Model and Storage structure:
Storage Variable:
Name Type

---- ----

svUserType1 oTheUser
svUserType2 oTheUser

oTheUser is a model Item as follows:
Name Type

---- ----

oTheUser Object
..oUserID Object
..oUserDetails Object

Name Type

---- ----

oUserID Object
..id String
..uniqueName String

Name Type

---- ----

oUserDetails Object
..ScreenName String
..gender String
..email String
..Telephone String

How would I access the data to set and Get values throught the structure
Something like the following which does not work
Var UserEmail = Apperyio.storage.svUserType1.get("$['svUserType1.oTheUser.oUserDetails'],'email'");


Get and Set multi level storage model Values using Javascript

Posted: Mon Jul 20, 2015 6:09 am
by Pavel Zarudniy

Hi Pete,
Please try to use:
code
Var UserEmail = Apperyio.storage.svUserType1.get("$['oTheUser']['oUserDetails']['email']");
/code
For more info please see this doc -
https://devcenter.appery.io/documenta...


Get and Set multi level storage model Values using Javascript

Posted: Mon Jul 20, 2015 9:31 am
by Pete Nellmapius

Thank You
I had to play with it but now understand.
The syntax you gave is correct
However svUserType1 is = oTheUser so does not need to mentioned.
so: Apperyio.storage.svUserType1.get("$['oUserDetails']['email']"); works.

Thanks for the help