Page 3 of 3

spliting an array

Posted: Fri Nov 01, 2013 9:10 pm
by Michael4771079

I don't have a "where parameter"
what screen or service do you mean?


spliting an array

Posted: Fri Nov 01, 2013 9:22 pm
by Maryna Brodina

Sorry, my bad - it's currentorder parameter in currentorderervice service on Vegetarian_Pizza page.


spliting an array

Posted: Fri Nov 01, 2013 9:34 pm
by Michael4771079

OK Maryna,

I sorry but this was the code that was used originally, details and result at the top of this post,

the data returned didn't allow me to map individual items in the array to labels
in the collapsible


spliting an array

Posted: Fri Nov 01, 2013 10:36 pm
by Maryna Brodina

If we understand correctly the problem is that data is saved, but you can't map it the way you need? If so there are two solutions:
1) you need to parse data using JS as we suggested here https://getsatisfaction.com/apperyio/...
2) In DB you have to save not array, but object

  • currentorder column type should be Object (not Array)
  • in mapping to currentorder parameter in currentorderervice service on Vegetarian_Pizza page add code (instead that one you have now)
    prereturn {"array": JSON.parse(value)};/pre
  • after you fill in currentorder column with data (at least one row) you have to change list/query services response in this collection. To do that run service test and when you have response click Automatically Create Service Response.

spliting an array

Posted: Sat Nov 02, 2013 12:56 pm
by Michael4771079

Hi Igor,
as you can see I am still confused with this,
as you can see after I implemented your code I got an error, some other suggestions have been made, however could you take one mare look at this as I need to rule out your approach before I make the changes that have been made above, project is as you left it.

yhanks for your help