Webform- How to dynamically provide dropdown options?

Hello,
I have a use case where we need to provide users only the options applicable to them when completing a webform. For example: a manager needs to only be able to select their associates from a dropdown list when completing a webform.

We already have a table with associates and their managers, so presumably some sort of filtering by the manager's ID could give us a list of available associates. But without having managers submit the webform, I don't know how it's possible to perform the filtering action. Ideally, this would be done in the same webform trigger.

Is this possible? How could we get this accomplished?

Thank you!

Comments

  • Greg_703914
    Greg_703914 Posts: 42
    edited March 2021

    I would also like to be able to do something very similar. Essentially I just want to look at a column in a table for dropdown menu options on a form. This table will have new rows added or deleted via a different process so it would be helpful if I could dynamically generate the dropdown options from a given column in a table.

  • Sean_510793
    Sean_510793 Posts: 69 admin

    Currently, this is most easily accomplished via the Send a form action. With the send a form action, you can Set the value of the multiple choice field. I hope that provides you with a suitable option. We are definitely contemplating but do not have on the roadmap an option for a drop-down powered by a Table.

  • Chuck_146211
    Chuck_146211 Posts: 36 admin

    Hi @Anna_272419 & @Greg_703914,

    Here's another way you may be able to incorporate dynamic dropdown options for multiple/single choice fields.

    The concept behind it is to have all your dropdown choices in a table, filter that table according to which choices you'd like available for a user to pick from, then use the output of the filtered table as the Choice options in your field config.

    Here's a quick rundown of it.

    • Create a table with rows that represent the potential choice options.
    • Use the action "Tables: Apply Filters" on the choice options table to filter for the options you'd like to present to a user.
    • Convert this filtered table to text by using the action "Tables: Convert data table to text".
      ** Make sure you're using '\n' as the row delimiter so you get one choice per line in your output.

    • Use the output field from the Convert data table to text step and paste it as a field reference in the Choices config for your Single Choice field (screenshot below).

  • This is helpful, but wouldn't it be more ideal to have a dynamic dropdown option prior to the workflow starting? Also, what are the row limits for a long text field?