I would like to show/hide records in VF if a value exists in a multi-select picklist.

Typically to render something true or false, I use == to check. However, I can't do this with a mutli-select picklist.

Thoughts? I am thinking something like the following needs to happen:

rendered="{!IF(contactskill.areas_of_expertise__c.contains(skill), true, false)}

CONTAINS seems to be working here, its from allowed functions for Visualforce.

rendered="{!CONTAINS(contactskill.areas_of_expertise__c, 'skill')}"

Based on your requirement you can use OR or AND functions to render based on multiple values:

    CONTAINS(contactskill.areas_of_expertise__c, 'option 1'),
    CONTAINS(contactskill.areas_of_expertise__c, 'option 2')
  • This works beautifully!!!! I am very, very happy!!!!! – Michele Kleinhomer Oct 18 '17 at 0:22

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.