function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ShreyankaShreyanka 

country field as Multi-select of countries which will be saved as a comma separated list

Hi everonye,

I have a requirement where I've to use Country field as multi-select of countries which will be saved as a comma separated list. I display this field on the screen flow. Could anyone help on this "how to achieve multi-select field of countries which will be saved as a comma separated list.


Thanks in advance!
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Shreyanka,

Do you have Country field as picklist in your object?

Thanks,
 
ShreyankaShreyanka
Hi Praveen,

Yes, have country field as multi-picklist which uses global value set.

Thanks!
TobyKutlerTobyKutler
One way to do this is with a loop and conditions. First, get the size count of the list you are looping through. Then loop through check to see if you are at the beginning or middle or very end. If middle of beginning add the value followed by a comma. If at the end the only add the value. There is a free managed package tool that does it (https://unofficialsf.com/new-flow-actions-to-convert-csv-strings-to-string-collections-and-vice-versa/). 

Read more on this here (https://salesforce.stackexchange.com/questions/359001/split-the-values-by-a-comma-and-pass-it-to-a-collection-variable)