Convert Selected Choices to Text Collection in Flow #inSalesforce

Convert Selected Choices to Text Collection in Flow #inSalesforce


Suppose, create choice resource, Name, text, Id accountChoice

Create text variable called selectedIds(available for input)


Assignment:


selectedIds Add accountChoice

selectedIds Add ;


Create formula named firstId - This extracts the first record Id from the left side of the selectedIds variable

TRIM(LEFT({!selectedIds}, FIND(";",{!selectedIds})-1))


Create a formula named removefirstId - This removes the first Id value and its semicolon from the selectedIds variable.

TRIM(SUBSTITUTE({!selectedIds},{!firstId}+";",""))


Note: The above is using this logic for the Id values. If you use it for other text values, you have to update the removefirstId formula

TRIM(

RIGHT({!selectedIds},

LEN({!selectedIds}) -

LEN({!firstId}+";")))



Create a text collection variable

recordIdCollection, text, Allow Multiple


Assignment:

recordIdCollection Add firstId

selectedIds equals removefirstId



Decision:

Are there other values?

Yes:

selectedIds does not equals 

Connect to Assignment

No:

Your Action...

















Visual: https://www.youtube.com/watch?v=8j3gBorBeh8




Comments