A.W.H.
Posts: 0
Joined: Sat Jun 20, 2015 7:02 am

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

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

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

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

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

A.W.H.
Posts: 0
Joined: Sat Jun 20, 2015 7:02 am

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

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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

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

Unfortunately, no.

A.W.H.
Posts: 0
Joined: Sat Jun 20, 2015 7:02 am

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

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

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

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

This is the way our platform works.

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

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

Hi
I get undefined error.

This is my Model

Image
Image

My js on success event.
Image

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

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

Hello Deon,

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

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

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

Yes and referenced the Type to the Model

Return to “Issues”