Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

multi drop down selections

Hi team,

My use case requires me to select multiple options like: north, south, east ,west which am able to configure and it's working perfectly.

But there should also be an option to select all(I.e North, south, east, west) and based on it data should be displayed.

Can someone help with the code.

  Discussion posts and replies are publicly visible

  • Hi,

    I think this piece of code should work for you

    a!localVariables(
      local!choiceLabels: { "All", "East", "West", "North", "South" },
      local!choiceValues: { 0, 1, 2, 3, 4 },
      local!dropDownValue,
      local!value,
      a!multipleDropdownField(
        choiceLabels: local!choiceLabels,
        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
            )
          )
        }
      )
    )

    In this, I have added an "All" label in the first index of the array of labels and values, and because of that, I have taken two variables. One for showing the correct value in the dropdown and the second one is to refer to other places where the value is required.

    Thanks