Skip to main content
November 16, 2022
Solved

Based on gridrowlayout selection dropdown field should be enabled

  • November 16, 2022
  • 5 replies
  • 0 views

Hi All,

How to enable the dropdown field based on gridLayout selection?

actually i am trying with the below code but it is not working as expected: Please help and suggest logic so that i will try to test it.

a!gridLayout(
  headerCells: {
    a!gridLayoutHeaderCell(label: "Dropdown")
  },
  columnConfigs: {
    a!gridLayoutColumnConfig(width: "DISTRIBUTE")
  },
  rows: {
    a!forEach(
      items: ri!data,
      expression: a!gridrowLayout(
        contents: {
          a!dropDownField(
            disabled: if(
              and(
                rule!APN_isNotEmpty(ri!selectedid),
                contains(fv!item.gfcid, ri!selectedid)
              ),
              false,
              true
            )
          )
        }
      )
    )
  }
)

    Best answer by mikes0011

    your contains() appears to be backwards.  the order is contains(array, value), whereas you have the value then the array.

    5 replies

    mikes0011
    mikes0011Answer
    Brainy
    November 16, 2022

    your contains() appears to be backwards.  the order is contains(array, value), whereas you have the value then the array.

    The Expression Guru
    November 16, 2022

    Thank you Mike
    Its working

    mikes0011
    Brainy
    November 16, 2022

    Cool, thanks for confirming.  FYI if you would press "verify" on my original answer, i'd enjoy the invisible Appian Brownie Points :)

    The Expression Guru