Page 1 of 2

How do I store all JSON data into a local stor. var.

Posted: Sat Aug 22, 2015 3:04 am
by A.W.H.

Hi, I need to figure out how to store a collection (which returns JSON as seen in the testing), into a single string variable.

Image

Then, I want to JSONify this string blob and then iterate through it nicely.

First, however, I am stuck to get the JSON from the database to the local storage. I am using a mapping. However, the following mapping does not store more than 1 record from the collection to my local storage variable.

Help? Image


How do I store all JSON data into a local stor. var.

Posted: Sat Aug 22, 2015 5:56 am
by Serhii Kulibaba

Hello,

You can save full response into storage variable on the success event:

Apperyio.storage.myArray.set(data);

here myArray - name of the storage variable, whicj has type=array of the objects
data - service's response data


How do I store all JSON data into a local stor. var.

Posted: Sat Aug 22, 2015 7:07 am
by A.W.H.

Thanks!


How do I store all JSON data into a local stor. var.

Posted: Sat Aug 22, 2015 12:04 pm
by A.W.H.

However, is there a way to map it (visually)? I'm a visual learner.


How do I store all JSON data into a local stor. var.

Posted: Sat Aug 22, 2015 2:46 pm
by Illya Stepanov

Unfortunately, no.


How do I store all JSON data into a local stor. var.

Posted: Sun Aug 23, 2015 1:13 am
by A.W.H.

So, you're telling me I can't map an array to an array. If not, why not?


How do I store all JSON data into a local stor. var.

Posted: Sun Aug 23, 2015 4:52 am
by Evgene Karachevtsev

This is the way our platform works.


How do I store all JSON data into a local stor. var.

Posted: Mon Feb 06, 2017 6:43 am
by Deon

Hi
I get undefined error.

This is my Model

Image
Image

My js on success event.
Image


How do I store all JSON data into a local stor. var.

Posted: Mon Feb 06, 2017 6:52 pm
by Serhii Kulibaba

Hello Deon,

Please clarify, did you create a Storage variable with the same name, based on that Model?


How do I store all JSON data into a local stor. var.

Posted: Thu Apr 06, 2017 9:29 am
by Deon

Yes and referenced the Type to the Model