Skip to main content
All CollectionsForms
SQL based dropdown elements in Forms
SQL based dropdown elements in Forms
Updated over a year ago

Users can create drop-downs (Select/MultiSelect) in Forms based on SQL query output.
​

Users can dynamically generate dropdown options in Forms based on data retrieved from a SQL query. This eliminates the need to manually update dropdown options and ensures that the available options are always up to date and accurate.

To add this new element to a form in Avenue, follow these steps:

  1. Navigate to the Forms section (left side of Avenue site)

  2. Click the plus sign to add a new element to the form.

  3. From the menu, select the Dropdown Select (SQL Generated) or Dropdown Multiselect (SQL Generated) option.

A property editor will appear on the right-hand side of the screen, which will assist you in creating the dropdown.

In the SQL Query section of the element's property editor, you can specify a SQL query to execute and the associated data source for the query.

Within the Signal Data section of the element's property editor, assign an ID to the data in the dataID entry. Then, you can define a label column and a value column from your SQL query. The label column provides the human-readable text displayed to the user, while the value column represents the corresponding data added/sent to your signal.


You can set the label column to firstName and the value column to email.
​
In the case where a person selects "Rob" from the dropdown element that is populated with the SQL query and data source, Rob's email (which is the corresponding value) will be sent as the data to the monitor.
​

It's also important to note that the label columns and value columns could also be the same (e.g., label: firstName and value: firstName).

After saving the form, it will be displayed with the element that was added and configured, which may look similar to the following example.


​

πŸ’‘ Please be aware that the preview feature has a 50-result limit, which does not affect the actual query results.

To generate signals for your monitor using the form, select the Slack/Webhook based monitor option when creating the monitor, and then choose the requisite form from the dropdown menu in the Select the Data section.

Once you have connected the form to the monitor, you can use it to generate signals by clicking the "Create Signal" button, which will create a new signal based on the data entered in the form.


​
​

Did this answer your question?