Page 1 of 1

Mapping Server Array to List

Posted: Mon Jul 14, 2014 9:44 pm
by anton6984647

Hello,
I'm having some difficulty mapping my server-generated array to a list that auto-expands.

Here are the two arrays I'm getting in server code testing:
{"usermessage":["message2","message3","message1","message0"],"fullname":["user2","user3","user1","user0"]}
and the relevant bit of server code:

responseBody.fullname = fn;
responseBody.usermessage = umess;
response.success(responseBody, "application/json");

Here is my response mapping:
Image

Is there another way I should be passing the parameters or assigning them?


Mapping Server Array to List

Posted: Mon Jul 14, 2014 9:45 pm
by anton6984647

This is what I'm getting in mobile preview. Each of these should be it's own list, instead of one big list item. Image


Mapping Server Array to List

Posted: Tue Jul 15, 2014 4:28 am
by Yurii Orishchuk

Hi Anton,

At first you probably have wrong "response" parameters in your service settings.

Please take a look on your service response tab and check whether you have "Array" check box checked for your "array-type" response fields.

See details on screen shot: http://prntscr.com/42sx01/direct

After, you will get in your mapping [] array-field where you can make following mapping:

See screen shot: http://prntscr.com/42sxog/direct

Regards.