Use Complex Filter Parts

ComplexFilterParts and SimpleFilterParts can be nested together to produce sophisticated filtering scenarios.

The sample code below shows how to create this nesting scenario.

This code represents the following business logic:

  • Retrieve all subscribers

    • (Where the Subscriber's SubscriberKey property is IN (or one of) the string values "1", "2", or "8" OR
    • Where the Subscriber's SubscriberKey property is IN (or one of) the string values "3", "6", or "12") AND
    • Where the Subscriber's Status property equals Active

The object structure of this business logic is:

  • ComplexFilterPart

  • ((SubscriberKey in"1", "2", or "8" OR SubscriberKey in"3", "6", or "12") AND (Status = Active))

  • ComplexFilterPart ((SubscriberKey in "1", "2", or "8") or(SubscriberKey in"3", "6", or "12"))

    • SimpleFilterPart (SubscriberKey in"1", "2", or "8")
    • OR
    • SimpleFilterPart (SubscriberKey in"3", "6", or "12")
  • AND

  • SimpleFilterPart (Status = Active)

The sample code below retrieves all active subscribers created after the specified date: