Skip to main content
matthiasb0001
February 3, 2022
Solved

Grid only has one row

  • February 3, 2022
  • 7 replies
  • 0 views

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"
    )
  }

    Best answer by agamb0001

    Hi Matthias, 

    Instead of making the variables in the CDT as multiple, why dont you make them single and use your CDT as a multiple variable, so that your data can look like the below:

    local!data: {
    {
    fixingDate: "28/02/2022",
    fixingFactor: 1,
    fixingType: 3,
    fixingLevel: 1,
    underlying: "Test"
    },
    {
    fixingDate: "28/02/2022",
    fixingFactor: 1,
    fixingType: 3,
    fixingLevel: 1,
    underlying: "Test"
    }
    }

    Note that the grid will be making rows based on the count of your product_cdt and not what it's internal structure is. 

    7 replies

    agamb0001
    February 3, 2022

    Can you check if your rule input is declared as multiple ?

    and, can you also provide your testing values for this rule input ?

    matthiasb0001
    February 3, 2022

    I tested like this and used the local as the data source for the grid:

    local!data:
    {
    fixingDate: {"28/02/2022", "28/02/2022"},
    fixingFactor: {1, 1},
    fixingType: {3, 3},
    fixingLevel: {1, 1},
    underlying: {"Test", "Test"}
    },

    The concerned variables in the CDT are set to multiple 

    agamb0001
    agamb0001Answer
    February 3, 2022

    Hi Matthias, 

    Instead of making the variables in the CDT as multiple, why dont you make them single and use your CDT as a multiple variable, so that your data can look like the below:

    local!data: {
    {
    fixingDate: "28/02/2022",
    fixingFactor: 1,
    fixingType: 3,
    fixingLevel: 1,
    underlying: "Test"
    },
    {
    fixingDate: "28/02/2022",
    fixingFactor: 1,
    fixingType: 3,
    fixingLevel: 1,
    underlying: "Test"
    }
    }

    Note that the grid will be making rows based on the count of your product_cdt and not what it's internal structure is.