Skip to main content
April 2, 2025
Question

Multiple dropdown values issue

  • April 2, 2025
  • 13 replies
  • 0 views

a!localVariables(
  
  local!choiceValues: cons!VS_VALUES(list of array : "AB","BC","CD",)
  local!dropDownValue,
  local!value,
  a!multipleDropdownField(
    choiceLabels: local!choiceValues,
    choiceValues: local!choiceValues,
    value: local!value,
    saveInto: {
      a!save(
        local!value,
        if(
          contains(
            save!value,
            index(local!choiceValues, 1, {})
          ),
          0,
          save!value
        )
      ),
      a!save(
        local!dropDownValue,
        if(
          contains(
            save!value,
            index(local!choiceValues, 1, {})
          ),
          remove(local!choiceValues, 1),
          save!value
        )
      )
    }
  )
)

Hi All. Hope you all are doing well. 

I am using multiple dropdown and working with records. The above code i am trying to edit already present value in the multiple dropdown. Above is the code . 

If i try displaying the selected value i am unable to deselect it and select new values and if i am able to do it i am unable to display already present value . 

Can anyone please help me with the point i am missing ?

Thank you very much in advance.

    13 replies

    stefanhelzle0001
    April 2, 2025

    Not sure what you are trying to do. That dropdown field already does it for you.

    a!localVariables(
      local!choiceValues: {"AB","BC","CD"},
      local!value,
      a!multipleDropdownField(
        choiceLabels: local!choiceValues,
        choiceValues: local!choiceValues,
        value: local!value,
        saveInto: local!value,
      )
    )

    April 2, 2025

    Thank you for your reply .

    This works . For example i select the value - "AB".

    When i come back again to edit the field and change the values to "AB","BC". I am unable to .

    prasantap0900
    April 3, 2025

    Dismiss the selected value. and choose the other one.

    April 3, 2025

    a!localVariables(
      local!choiceValues: {"AB", "BC", "CD"},
      local!dropDownValue: {},
      local!value: {},
      a!multipleDropdownField(
        choiceLabels: local!choiceValues,
        choiceValues: local!choiceValues,
        value: local!dropDownValue,
        saveInto: {
          a!save(local!value, save!value),
          a!save(local!dropDownValue, save!value)
        }
      )
    )

    Hope this works for you!

    April 3, 2025

    Thank you for your response, but its not working as expected.

    April 3, 2025

    For example:

    ...

    ...

    ...

    ...

    I have the summary page , and i want to edit a field which already has a value( Condition - "Like New") . So i go and click on update and try to change the value to "Minor Use" , "Retired".

    So , this is what i am trying to achieve it.