Page 1 of 1

How to display array contents in a list/grid

Posted: Thu Jul 17, 2014 8:14 am
by Anil Sagar

Hi, I have a column 'array A' of type array in my collection 'coll A'. When I try to display array A in a list or grid (with a label), all array items get displayed inside the same label, separated by commas. I want the array items to be displayed in different labels (inside the same list/grid). No. of labels varying depending on the no. of array items.

How can I achieve this?


How to display array contents in a list/grid

Posted: Thu Jul 17, 2014 9:18 am
by Evgene Karachevtsev

Hello,

You should redo the structure of response. Manually create the array from response parameter 'array A' or on the test tab of service settings, click Automatically Create Service Response


How to display array contents in a list/grid

Posted: Thu Jul 17, 2014 9:19 am
by Anil Sagar

I have searched earlier such questions in this forum and one of them I found interesting was https://getsatisfaction.com/apperyio/...

My problem is that my arrayA does not show any other sub-item like arrayA in the response mapping. Thus I am not able to map arrayA to a list_item.

I have defined arrayA in ApperyDB as:

["20 SMS free with Rs. 100 SMS pack","1 GB free with 5GB pack for Rs. 300"]

This shows 2 strings stored in arrayA. And I want to display them as two separate list items in the UI.


How to display array contents in a list/grid

Posted: Thu Jul 17, 2014 10:04 am
by Anil Sagar

Thanks Evgene. Your suggestion worked like a charm. Is this a bug in the automated service creation from DB services?


How to display array contents in a list/grid

Posted: Thu Jul 17, 2014 11:26 am
by Anil Sagar

This is working fine for list mapping but I am still struggling for grid mapping. What am I doing wrong? Snapshot below.

Image


How to display array contents in a list/grid

Posted: Thu Jul 17, 2014 12:01 pm
by Anil Sagar

Mapping is correct for grid. Problem was actually coming from another HTML component placed in the same grid. Once that HTML component was taken out, the problem solved for the grid as well. Array is mapping fine in the grid now.


How to display array contents in a list/grid

Posted: Thu Jul 17, 2014 12:46 pm
by Evgene Karachevtsev

Anilsagar,

Glad it works, do not hesitate to contact us if you need any further help.