Forums

Forums / Developing Portals / contains values filter in fetchxml for multiselect picklist

contains values filter in fetchxml for multiselect picklist

2 posts, 0 answered
  1. mani varma
    mani varma avatar
    8 posts
    Registered:
    21 Jul 2020
    29 Sep 2021
    Link to this post
    Not able to fetch records when 
    <condition attribute="field1" operator="contain-values" >
            <value>883980001</value>
          </condition>

    contain-values filter operator is used for multiselect picklist, which filter should i use.


  2. Brady Ward
    Brady Ward avatar
    92 posts
    Registered:
    19 Aug 2021
    30 Sep 2021
    Link to this post
    Hello Mani,

    Although contain-values is not supported in the builder, you can manually edit the FetchXML (under the Data tab) and add the following condition/filter:

    <filter type="and">
        <condition attribute="new_testmultiselect" operator="contain-values">
            <value>100000001</value>
            <value>100000001</value>
        </condition>
    </filter>

    One issue I noticed, if there is only one value, it does not pick it up and throws an error. If you add the same value twice, the filter will start working (ie. the snippet above has the same value twice to avoid the error). If you have more than one value in the condition list, you do not need to repeat any.

    Please also note, you will not be able to use the FetchXML builder while the above snippet is present. If you need the builder, remove the snippet and add it back in when you are done with the builder.

    If you have any questions, feel free to reach out to support at support@crmportalconnector.com or join one of our daily Q&A sessions.

    Thank you kindly,

    Brady
    TPC Application Consultant
2 posts, 0 answered