Complex filter conditions

EXAMPLE: If you want to filter SharePoint items, based on the following condition:

Department == Marketing AND (Country == Canada OR Country == USA)

Perform the following:

  1. Click Administration » Settings » Advanced » SharepointConnector » <your site name> » List mappings » <your list mapping name> » SharePoint filter and set the logical operator to AND.
  2. Under SharePoint filter, click Filter condition » Create new.
    Fill out the following properties:
    • In Field name, enter Department
    • In Field value, enter Marketing
    • In Default field value, enter Marketing
    • In Comparison operator, enter ==
  3. Under SharePoint filter, click Logical groups » Create new.
    The logical group contains collection of filter conditions and collection of other logical groups. Every logical group has an operator that relates the filter conditions and the nested groups. This allows you to construct complex logical expressions.
  4. Set the group’s logical operator to OR and click Save changes.
    In the tree on the left, a new item appears under Logical groups.
  5. Expand the item and click its Filter conditions » Create new.
    Fill out the following properties:
    • In Field name, enter Country
    • In Field value, enter Canada
    • In Default field value, enter Canada
    • In Comparison operator, enter ==
  6. Click Save changes and click again Create new.
    Fill out the following properties:
    • In Field name, enter Country
    • In Field value, enter USA
    • In Default field value, enter Canada
    • In Comparison operator, enter ==
    • NOTE: When you have a field that appears more than once in the filter, in every appearance the default field value must be the same. In the above example, it must be either Canada or USA. Therefore, when a new item comes from Sitefinity CMS to SharePoint it will have country Canada or USA and the item will pass the filter in future synchronizations.

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?