Have you ever been asked to select a response but none of the options apply? You can enable users to type in their own response, which is then added to the dropdown menu (aka a picklist) and to your domain table!
You can easily do this using automations in the Builder. Let’s see it in action:
Set up visibility
- To start off, add a block and insert five components: a content box, a data cell bound to a picklist, an empty data cell, and two buttons. See the example below.
Next, let’s set the empty data cell to show conditionally when the user selects “Enter my own” from the picklist. To do this, click on the empty data cell and in the right properties panel, select the the Display tab.
Set the data cell visibility to:
=[Color]="Enter my own"
In our example below, we named our picklist column “Color.”
- Now, let’s set the active button visibility —we’ll add the automation later in step 6. Enter:
=AND([Color]="Enter my own",$[Color]<>"")
This button will now display only when the data cell shown above
$[Color] is visible and has content in it.
- To set the disabled button visibility , enter:
=AND([Color]="Enter my own",$[Color]="")
This button will now display only when the data cell shown above (
$[Color] ) is visible and has no content in it.
Builder tip: Our “disabled button” is simply a button that’s styled to appear disabled and has no automation associated with it. You can read more about app styling here.
Add the automation
Next, let’s dive a little deeper into the automation for the active button. When users add their own option to the picklist, we want it to display above “Enter you own,” which should always be the last option in the menu.
Click on the active button and from the properties panel select the Actions tab.
Select +Create an automation then hit the blue [+] and select Delete a row > Specified row. Enter:
This will delete “Enter your own” from the picklist.
Hit the blue plus [+] again and select Add a row to > [Table Name]. Take data from the value
=$[Color]and write it to
=[Color]. This adds the new row to the domain table and creates a new option in the picklist.
Hit the blue plus [+] again and select Overwrite . Take data from
=FindLastRow(Colors)and write it to the column
=[Color]as a value.
Next, let’s add “Enter your own” back to the picklist domain table by creating a new Add Row step. Take data from the value
="Enter my own"and write to the column
Finally, add another Overwrite step taking data from
=$[Color]and writing to
="". This lets users add a new option to the dropdown table and adds a new row to your domain table.
Following this overview will enable your team members to type in their own response when the other options do not apply. Doing this will also give you more data from users around critical functions or business needs, which would be a big win for you or your admins!
Not yet a Honeycode Customer? Sign up for our free version here.