Skip to main content

4 replies

Participating Frequently
Oct 18, 2022 5:16 AM UTC

Hi, you can simply use the picker field date field anything you want.

For more check the link https://docs.appian.com/suite/help/22.3/Editable_Grid_Component.html

=a!localVariables(
  local!items: {
    {item: "Item 1", qty: 10, unitPrice: 10, date:now()},
    
  },
  a!gridLayout(
    label: "Products",
    instructions: "This is a grid layout with column weights: 5, 1, 1, 2",
    headerCells: {
      a!gridLayoutHeaderCell(label: "Item"),
      a!gridLayoutHeaderCell(label: "Qty"),
      a!gridLayoutHeaderCell(label: "Unit Price"),
      a!gridLayoutHeaderCell(label: "Date"),
      a!gridLayoutHeaderCell(label: "Total", align: "RIGHT")
    },
    columnConfigs: {
      a!gridLayoutColumnConfig(width: "DISTRIBUTE"),
      a!gridLayoutColumnConfig(width: "DISTRIBUTE"),
      a!gridLayoutColumnConfig(width: "DISTRIBUTE"),
      a!gridLayoutColumnConfig(width: "DISTRIBUTE"),
      a!gridLayoutColumnConfig(width: "DISTRIBUTE")
    },
    rows: a!forEach(
      items: local!items,
      expression: a!gridRowLayout(
        contents: {
          a!textField(
            value: fv!item.item,
            saveInto: fv!item.item
          ),
          a!integerField(
            value: fv!item.qty,
            saveInto: fv!item.qty
          ),
          a!floatingPointField(
            value: fv!item.unitPrice,
            saveInto: fv!item.unitPrice
          ),
          /*date time */
          a!dateTimeField(
            value: fv!item.date,
            saveInto:fv!item.date
          ),
          a!textField(
            value: dollar(tointeger(fv!item.qty) * todecimal(fv!item.unitPrice)),
            readOnly: true,
            align: "RIGHT"
          )
        }
      )  
    ),
    rowHeader: 1
  )
)

Inspiring
Oct 18, 2022 7:37 AM UTC

Could you please explain a bit more. if you want multiple columns then you gridrowlayout with multiple columns. If you want a single column but diff field type for different rows then based on some values you have to set the fields via if else condition.

New Participant
Mar 15, 2023 6:36 PM UTC

can you share an example for the second point you mentioned on single column?

abhayd3663
Brainy
Mar 15, 2023 7:21 PM UTC

You mean to show/hide column on different condition? If that is the question you can configure that using showWhen within the a!gridField() or a!gridLayout()