Restricting Form Dropdowns
Restricting Form Dropdown Options with Organization Variables
Last updated
Restricting Form Dropdown Options with Organization Variables
Last updated
Feedback
⬆️ CannyCopyright © 2024 Rewst
The Onboarding form includes a number of fields to be filled out when onboarding new users. The default behavior of all the dropdown fields is to pull the list of options from the API. This is because the dropdown fields have Dyanmic Options set.
While this may work in many cases, there are scenarios where it makes sense to limit the number of options based on the customer segment you're working with. An example of this might be that you need to limit which email domains each customer sees. You may also want to limit which locations customers can choose from. In any case, you can set specific values for the default_form Organization Variables to use in your forms.
Using the User Onboarding Form and Workflow The example we'll be looking at is specifically for the User Onboarding Form and Workflow as it is currently the most likely use-case.
You can add default values for any of the Form Organization variables below:
To view the form org variables table, click here.
As noted above, a good use case for this is to limit the email domains that customers can choose from to simplify their experience and potentially make the form more secure. To do this, you can do the following:
Go to Configuration → Organization Variables.
Click Add at the top right.
Type in the following for the new Organization Variable:
Name: form_default_email_domain
Value: ["email domain"]
Category: General
Organization: Choose Your Organization
Variable values must exist Any value you add to a variable must exist in the list that the form value is pulling from. An example of this would be that any email domain added as a default must exist in the list that is pulled from the Microsoft API.
Next, the variable can be added to the form field.
Go to Automations → Forms.
Open the User Onboarding Form.
Click to open the settings for the Email Domain Name field.
Type true in the schema.enumSourceWorkflow.input.force_default
setting.
Type email_domain in the schema.enumSourceWorkflow.input.choose_variable
setting.
You only need to add the latter half of the form_default
variable when adding it to the schema.enumSourceWorkflow.input.choose_variable
setting.
Save the Form.
Make sure to set the Org variable values for any Company Organization using the form For example, maybe there are three Company Organizations that need to use the same form with a list of 3 domains to choose from. Each Organization needs to have the variable added with the domain values set. If you only set the variable and values in Company 1, the other two Companies won't see any options to choose from.