Grid only has one row

Hi guys, 

I think I am close to the solution, but I've been stuck with this for a while and figured asking cannot hurt.

I am creating an interface which is supposed to show the user data from another User Input Task and have them confirm it has been input correctly. For this I use a read-only grid which I configured according to the Appian tutorial. However, it displays the data in only one row, albeit separated in the pre-defined columns (so e.g. it will say for Underlying "Underlying1; Underlying 2" in one cell).

The data is pulled from a CDT as a rule input. It contains "flat" data like single booleans, but also arrays. For this exercise, only arrays are concerned. Do I have to manipulate the data beforehand or am I missing something major?

My code:

a!gridField(
  label: "Fixing Levels",
  labelPosition: "JUSTIFIED",
  data: ri!product_cdt,
  columns: {
    a!gridColumn(
      label: "Underlying",
      value: fv!row.underlying,
      align: "START",
      width: "AUTO"
    ),
    a!gridColumn(
      label: "Fixing Date",
      value: fv!row.fixingDate,
      align: "START",
      width: "AUTO"
    ),
    a!gridColumn(
      label: "Fixing Type",
      value: fv!row.fixingType,
      align: "START",
      width: "AUTO"
    ),
    a!gridColumn(
      label: "Fixing Level",
      value: fv!row.fixingLevel,
      align: "START",
      width: "AUTO"
    ),
    a!gridColumn(
      label: "Fixing Factor",
      value: fv!row.fixingFactor,
      align: "START",
      width: "AUTO"
    )
  }

  Discussion posts and replies are publicly visible

Parents Reply
  • +1
    Certified Lead Developer
    in reply to Matthias Brixius

    Hi Matthias, 

    You could use something like this. Use index in case different columns of  your cdt may not have same length

    local!data: {
    fixingDate: { "28/02/2022", "29/02/2022" },
    fixingFactor: { 1, 1 },
    fixingType: { 3, 3 },
    fixingLevel: { 1, 1 },
    underlying: { "Test", "Test" }
    },
    local!gridData: a!forEach(
    items: enumerate(
    count(cast(typeof({}), local!data.fixingDate))
    ),
    expression: {
    fixingDate: local!data.fixingDate[fv!index],
    fixingFactor: local!data.fixingFactor[fv!index],
    fixingType: local!data.fixingType[fv!index],
    fixingLevel: local!data.fixingLevel[fv!index],
    underlying: local!data.underlying[fv!index]
    }
    )

Children