I am trying to use multi select picklist in a lightning flow. Picklist values are being populated by a record choice set. I want to get the id of all selected picklist values. I came to know the limitation of multi select choice field which says flow variable will contain only last selected value. I need all selected records to process. Is there any workaround for this?
Sounds like the documentation needs to be written more clearly. When you set up a record choice set, you choose the fields to use as the labels and values of each generated choice. And then you can optionally choose to store additional fields from the generated choice in variables.
It's the second part that only respects the last selected choice. You can get the full list of selections by referencing the checkbox group or multi-select picklist component.
For example, if I selected three accounts, when I reference the checkbox group: - in a Display Text component, it resolves to "Edge Communications; Burlington Textiles Corp of America; Salesforce" (which respects the labels for my record choice set). - in a logic context (like Decision or Assignment), it resolves to a semicolon-delimited list of the IDs (which respects the values for my record choice set).
If I chose to additionally store the AccountSource field value in a flow variable, that variable would resolve to only the AccountSource value for the "Salesforce" account. That's because it's a Text variable and can only store one value at a time.
Those who are having the same issue, please refer to this blog:-