Skip to main content
Known Participant
Nov 16, 2022 5:42 PM UTC
Solved

Based on gridrowlayout selection dropdown field should be enabled

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

    mikes0011
    mikes0011Answer
    Brainy
    Nov 16, 2022 6:54 PM UTC

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

    The Expression Guru

    5 replies

    mikes0011
    mikes0011Answer
    Brainy
    Nov 16, 2022 6:54 PM UTC

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

    The Expression Guru
    Known Participant
    Nov 16, 2022 7:14 PM UTC

    Thank you Mike
    Its working

    mikes0011
    Brainy
    Nov 16, 2022 7:26 PM UTC

    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