The Choice component allows you to select an option from a predefined list.
The choice component requires two columns from your sheet:
A list of choices (Apples, Oranges, Pears... etc)
A column where the choice will be recorded for each list item
You can pre-populate the second column with default choices that people can override.
Here's a detailed explanation:
Let's imagine that we want to record what people's favorite food is.
Step 1: Create a sheet which has different people in our rows.
Step 2: On a separate tab of your spreadsheet, create another column with unique options users will be able to choose from.
Step 3: Back in Glide, add your choice component and make sure
Options sheet and
Options column fields are connected to where your options are located in your Google Sheet. Then make sure that the
Column field (under Data) is connected to the column where you want the choices to be recorded.
Step 4 (optional): If you want your list items to have default values, rather than being blank - pre-populate the cells with whichever choice you want to appear as default. This is of course overridable by users.
Optionally, you can have the choice component record different values to your sheet than the ones that are displayed in the app by using the 'Display As' property.
For example in our sheet we have two columns in our options sheet:
If we wanted our choice component to write the
Food Code to our sheet but display the
Food name in the app, then we can select
Food Code for the Value and
Food as the Display as option.
Now when users choose their favorite food, our sheet will receive that food's specific code - rather than the name of the fruit.
There are many reasons why you might want to do this. Perhaps your values are too long to display in a choice component, or maybe the values you want the choice to add to your sheet are actually image links that don't display in the image component.