Anil Sagar
Posts: 0
Joined: Fri Jul 04, 2014 1:13 pm

How to display array contents in a list/grid

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?

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

How to display array contents in a list/grid

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

Anil Sagar
Posts: 0
Joined: Fri Jul 04, 2014 1:13 pm

How to display array contents in a list/grid

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.

Anil Sagar
Posts: 0
Joined: Fri Jul 04, 2014 1:13 pm

How to display array contents in a list/grid

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

Anil Sagar
Posts: 0
Joined: Fri Jul 04, 2014 1:13 pm

How to display array contents in a list/grid

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

Image

Anil Sagar
Posts: 0
Joined: Fri Jul 04, 2014 1:13 pm

How to display array contents in a list/grid

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.

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

How to display array contents in a list/grid

Anilsagar,

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

Return to “Issues”