Using a dynamic choice to select multiple records in visual workflow
With a small trick, Dynamic choice elements in visual workflow can be used to display multiple records, and only act on the selected record(s).
In a previous post, I described how to create a button that could copy all attachments from an email to the parent case.
I’ll now describe a more advanced version, which uses a dynamic choice to display a checkbox for each attachment, and only attaches the selected item(s).
The dynamic choice flow resource makes it straightforward to display multiple records as checkboxes. However, it does not provide a clear mechanism to take action when multiple records are selected. Dynamic Choices can only be mapped to a sObject variable, not a sObject collection. sObject variables can only store a single record, and therefore per the docs, only the most recently selected record that will be stored.
When a multi-select choice field uses a dynamic...