Indexing array in the grid

Hey Everyone ,

I need to display the data in the grid as :

Type Description Country
Nameabc1 abc

Brasil , India

nameabc2 def

Nepal

My data looks like . 

[Type=[id=1, name=nameabc1], country=[id=Bra, name=Brasil]; [id=Ind, name=India], description=abc];[Type=[id=2, name=nameabc2], country=[id=Nep, name=Nepal], description=Testing def]

The Problem I am facing is on indexing the country column . 
When I index it , it says the totalcount of grid =2 , but total data for the grid is=3 .
Its because when I country column is taking --> [id=Bra, name=Brasil]; [id=Ind, name=India];[id=Nep, name=Nepal] .
Instead of , [[id=Bra, name=Brasil]; [id=Ind, name=India]]  ; [[id=Nep, name=Nepal]].

Any suggestion how I can add those extra "[ ]" , so that I can display the country accordingly . ?????

Thanks in advance .

  Discussion posts and replies are publicly visible

Parents Reply
  •  a!gridField(
            label: "Deal Collateral",
            labelPosition: "COLLAPSED",
            totalCount: local!datasubset.totalCount,
            emptyGridMessage: resource(
              "No Collateral available"
            ),
            columns : {
                a!gridTextColumn(
                label: resource("Type"),
                field: "collateraltype",
                data: a!forEach(
                  items: local!datasubset,
                  expression: a!forEach(
                    items: fv!item.data,
                    expression: a!forEach(
                      items: fv!item,
                      expression: index(
                        index(
                          fv!item,
                          "Type",
                          null
                        ),
                        "name",
                        null
                      )
                    )
                  )
                )
              ),
              a!gridTextColumn(
                label: resource(
                  "Description"
                ),
                field: "description",
                data: a!forEach(
                  items: local!datasubset,
                  expression: a!forEach(
                    items: fv!item.data,
                    expression: a!forEach(
                      items: fv!item,
                      expression: index(
                        fv!item,
                        "description",
                        null
                      )
                    )
                  )
                )
              ),
              a!gridTextColumn(
                label: resource(
                  "Count of Country(test)"
                ),
                field: "country",
                data: a!forEach(
                  items: local!datasubset,
                  expression: a!forEach(
                    items: fv!item.data,
                    expression: a!forEach(
                      items: fv!item,
                      expression: a!forEach(
                        items: fv!item,
                        expression: count(
                          fv!item.country
                        )
                      )
                    )
                  )
                )
              ),
              a!gridTextColumn(
                label: resource(
                  "Country"
                ),
                field: "country",
                data: a!forEach(
                  items: local!datasubset,
                  expression: a!forEach(
                    items: fv!item.data,
                    expression: a!forEach(
                      items: fv!item,
                      expression: a!forEach(
                        items: fv!item,
                        expression: a!forEach(
                          items: fv!item.country[1],
                          expression: fv!item
                        )
                      )
                    )
                  )
                )
              )
            }

    gives me the table as below :

    Type Description Count of country(test) Country
    Nameabc1 abc 2

    Brasil 

    nameabc2 def 1

    Nepal

    a!foreach(

    items: local!datasubset,

    expressions : local!datasubset .data

    )

    Returns: [Type=[id=1, name=nameabc1], country=[id=Bra, name=Brasil]; [id=Ind, name=India], description=abc];[Type=[id=2, name=nameabc2], country=[id=Nep, name=Nepal], description=Testing def]

    I am not able to show all the countries as it says the totalcount exceed the number of largest column data .

Children