Choice is a resource type and it is only available in Screen flow, and it can only be used in the specific inputs on a Screen component, namely Checkbox Group, Radio Buttons, Picklist, Multi-Select Picklist, and Dependent Picklists. (What to learn about all the inputs on Screen component? Check here)
There are three types of Choice – Choice, Record Choice Set, and Picklist Choice Set. Let’s go through how each of them works.
Essentially, the purpose of having a choice is that you can let it display one value, but represents another one. For example, you can let the choice shows a sentence like below:
But assign the value as True:
So once an user chooses this choice, the value will be registered as True, instead of “I want to sign up for the blog”.
There are five data types for choice, and for text type, you can even display a text input for users to enter the value, like “Other” option for example.
After you create all the choices, putting them all into the screen component.
2: Picklist Choice Set
As you might have noticed, if you use the “choice” resource, you will have to create them one by one. When you want to show many options, this will take a considerate amount of time. This is when the choice set can help.
If the options are exactly the same as one of your picklist field, you can use the picklist choice set to get those values as a choice resource. Simply choose the right object, the data type of the existing field (either regular or multi-select picklist), and the target field.
Then instead of putting several choices in the component, you only need to put one choice set.
3: Record Choice Set
Record choice set is an interesting resource. It consists of three steps:
- Get all the records that meet certain criteria
- Choose one field and make a choice set of the values of that field of all selected records from step 1
- If a record is chosen by user, store more fields of that record
It might sounds a bit complex, so let’s use an example:
To get all the accounts owned by me (step 1), and use the account name of those accounts as choice set (step 2). If an account is chosen, I want to save the website and email as well (step 3).