I have 6 multi picklists.

I pushed all the selected values into Set

For Example:

Picklist A:



Picklist B:



Picklist C:




Assuming I selected all the values - Set will be :

Cherry;Apple, Apricots;Avocado, Banana;Blackberries;Blackcurrant

Which mean the Set is separated via ';' between the values in the same picklist, but between picklists it will be separated with ','

When I try now to use IN: in query, It kind of ruins me the query.

Any Idea how to replace everything to ';' or to ',' but not both?


If you have a Set<String>, then there are no commas unless you concatenate the Set with a String to see a String version of the Set.

If each item in the Set is a multi-select picklist value, and you are doing SOQL queries there are special keywords such includes and excludes to help construct the appropriate queries. See Querying Multi-Select Picklists for more information.

Use this search - https://salesforce.stackexchange.com/search?q=multi-select+picklist+query - to see examples on this forum too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.