I have a dynamically populated Checkbox Group
element on a Flow Builder
screen which has many checkbox items.
When a user makes multiple selections – how do I get all these selections?
It appears that the Record Choice Set
only outputs a single selection and not the other items selected.
Essentially there can be only one output from a multiple select checkbox group?
How do I get all the selected items?
Best Answer
The Record Choice Set retains a concatenated string value (of Choice Stored Values - typically record IDs) of the selected choices. This then needs to be parsed to get to the individual values.
A good approach is to use a separate lookup to create an sObject collection variable, which replicates the dynamic choice lookup, then parse the dynamic choice output string to check if it contains the id (i.e. it was selected). It's a bit painful, but works.
1) Ensure that your dynamic record choice is storing the record ID
2) Take note of the record choice API name![enter image description here](https://i.stack.imgur.com/mAWlV.png)
3) Assign choice to a text variable![enter image description here](https://i.stack.imgur.com/XNhaX.png)
4) Work through your separate lookup to see if the ID is 'contained' in the returned string...![enter image description here](https://i.stack.imgur.com/xy4Ig.png)