Leonardo Valentin Zeferino
Posts: 0
Joined: Fri May 29, 2015 2:07 pm

How can I access an array inside of other array in local Storage?

I'm trying to run the bellow code but it's occouring an error in "data.company_id.id":
User transformation function exception. Reason: Cannot read property 'id' of null

code
var dataString = localStorage.getItem("selectedItem");
var data = JSON.parse(dataString);

return '{"$and": [{"user_id.id":"' + Apperyio.storage.id_token.get() + '"},{"company_id.id":"' + data.company_id._id + '"}]}';
/code

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

How can I access an array inside of other array in local Storage?

Hello Leonardo,

Please use storage feature instead of simple localStorage.
There is an example of usage arrays in storage: https://devcenter.appery.io/documenta...

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

How can I access an array inside of other array in local Storage?

Your link is broken. Please update link.

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

How can I access an array inside of other array in local Storage?

Thanks, how can I append to a storage variable to create an array though. This link just explains get and update of standard storage variables

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

How can I access an array inside of other array in local Storage?

Hello,

Please create a Storage variable, based on the Model with a type "array" there

Return to “Issues”