Skip to main content
Participating Frequently
Aug 1, 2024 3:31 PM UTC
Question

Help Needed: Multi-Select Dropdown with Pre-Selected Options and Dynamic Update

Hi Community,

I have a requirement involving a multi-select dropdown in an Appian interface. Here's the scenario:

  1. First Screen:

    • I have a multi-select dropdown that is a mandatory field.
    • Users must select at least one option.
    • The selected options are saved in the database table, with each option stored in a separate row.
  2. Next Screen:

    • The same multi-select dropdown is presented, but it is not a mandatory field.
    • When the page loads, it should pre-select the options that the user selected in the previous screen (fetched from the database).
    • The current user should be able to select more options or deselect previously selected options.
    • Upon submission, the form should save the updated selections.

I am looking for guidance on how to:

  • Pre-select the options in the multi-select dropdown based on the user's previous selections.
  • Allow users to dynamically update their selections (add or remove options) and save these changes.

Any help or examples on how to implement this would be greatly appreciated.

Thank you!

7 replies

stefanhelzle0001
Brainy
Aug 1, 2024 3:54 PM UTC

The selected items in any dropdown are defined by the "values" parameter.

Do you already have any code to share?

Participating Frequently
Aug 2, 2024 11:49 AM UTC

Apologies for the late reply, Stefan, and thank you for responding. I have opted for an editable grid instead of multiple dropdown fields, as the latter makes it very complicated.

Participating Frequently
Aug 6, 2024 9:24 AM UTC

you mentioned it was a mandatory field , how did you replaced a multiple dropdown component with an editable grid?

Participating Frequently
Nov 28, 2024 1:42 PM UTC

Sorry for the very late reply. I swapped the multiple dropdown component for an editable grid by adding a dropdown field to the grid. I made the dropdown field mandatory, so users must select a value before moving on. Let me know if you need more details!

prasantap0900
Participating Frequently
Aug 5, 2024 6:22 AM UTC

You can query the previous data you have, and set the data with the help of a!defaultValue function. 

rajnis1428
Participating Frequently
Oct 30, 2024 9:26 AM UTC

Hi [mention:50e3255798df4b9dab66e972c17a0eb4:e9ed411860ed4f2ba0265705b8793d05] 

Did you solve the your 2nd problem? How is it?

Please reply...

Thank you

Participating Frequently
Nov 28, 2024 1:47 PM UTC

Sorry for the very late reply. I replaced the multiple dropdown component with an editable grid that includes a dropdown field. The dropdown shows pre-selected values from the previous screen (fetched from the database), and the user can add more options or remove previously selected ones. Let me know if you need more details!