Page 4 of 9

saving labels to array

Posted: Wed Sep 25, 2013 9:46 am
by Michael4771079

Hi Marina,
I made changes from Igor, but I am still getting an error
here are some screenshots

Image

Image


saving labels to array

Posted: Wed Sep 25, 2013 11:21 am
by Maryna Brodina

Hello! We'll take a look.


saving labels to array

Posted: Wed Sep 25, 2013 12:02 pm
by Maryna Brodina

Do you specify object_id? because without this parameter PUT method returns 405 Method Not Allowed.
Also you should set X-Tiggzi-Session-Token, without this parameter method PUT returns 401 Unauthorized


saving labels to array

Posted: Wed Sep 25, 2013 12:12 pm
by Michael4771079

Thanks Marina,

I have these set in mapping, the login and other services in the app work in apperyio tester, here is the mapping

Image


saving labels to array

Posted: Wed Sep 25, 2013 2:11 pm
by Maryna Brodina

In mapping from localStorage variable favorites to parameter favorites add the following code:
prereturn JSON.parse(value);/pre


saving labels to array

Posted: Wed Sep 25, 2013 2:41 pm
by Michael4771079

Cheers, thanks alot,
array is now saving to db.

The next part I dont know is,
how I am going to map the array to each of the labels in the collapsible block,
there are 5 labels.

screenshot

Image

thx for your patience


saving labels to array

Posted: Wed Sep 25, 2013 4:09 pm
by Kateryna Grynko

Hi Michael,

It depends on response structure.

If this is an array of objects take a look at here please: http://docs.appery.io/documentation/u...

If this is an array of simple values you would need JavaScript code to process the array.


saving labels to array

Posted: Wed Sep 25, 2013 4:18 pm
by Michael4771079

Thanks Katya,
this is an entry in the array
{"taxicompanyname":"Airport Taxis","town":"NEWCASTLE UPON TYNE","taxiemail":"a href="mailto:frank@airport-taxis.co.uk" rel="nofollow"frank@airport-taxis.co.uk/a","taxiphone":"0191 4880751","textback":"Text Back"}

there are 5 labels, so I guess I will need to use js,

do you have a sample of the code for this

Is it correct that I need to map the array to localstorage and then run the js to populate the labels in the collapsible block?

thanks


saving labels to array

Posted: Wed Sep 25, 2013 8:47 pm
by Michael4771079

hello


saving labels to array

Posted: Wed Sep 25, 2013 9:21 pm
by Kateryna Grynko

Hi Michael,

There are objects in your array so you can use mapping and the process will be automated. You can find an example on the link above.