Complex filters

Quick reference about Complex Filters in Salesforce Marketing Cloud (SFMC) with SSJS (server-side JavaScript).

Basic usage

{
    Property: "IsActive", 
    SimpleOperator: "equals", 
    Value: true 
}

Complex usage

{
    LeftOperand: {
        Property: "Adult", 
        SimpleOperator: "equals", 
        Value: true 
    },
    LogicalOperator: "OR",
    RightOperand: {
        LeftOperand: {
            Property: "Age", 
            SimpleOperator: "isNotNull",
            Value: "" 
        },
        LogicalOperator: "AND",
        RightOperand: {
            Property: "Age", 
            SimpleOperator: "greaterThan", 
            Value: 18 
        }
    }
}

Operators

Filter operators

Use these operators when building filters for most objects.

  • equals
  • notEquals
  • greaterThan
  • lessThan
  • isNull
  • isNotNull
  • greaterThanOrEqual
  • lessThanOrEqual
  • between
  • IN
  • like

The following operators work only for the DataFilter property:

  • existsInString
  • existsInStringAsAWord
  • notExistsInString
  • beginsWith
  • endsWith
  • contains
  • notContains
  • isAnniversary
  • isNotAnniversary
  • greaterThanAnniversary
  • lessThanAnniversary

WARNING

The IN property evaluates to True if the value of the specified property is in the specified list.

Help me turn coffee into code

This website is provided to you free of charge. However, a lot of time and effort are spent to write, test and mainain the code. Please consider supporting my work by buying me a cup of coffee.

Last Updated: