10 Replies Latest reply on Aug 21, 2017 9:55 PM by claudiazoglmann

    Eloqua Bulk Api Filtering using `OR` clauses

    3066566

      Hello,

      I'm trying to construct a fairly simple filter clause following: http://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAB/index.html#CSHID=BulkFiltering

      The goal is to query activity by a list of known `Activity.Asset.Id`s.

       

      When I run the query with this filter

       

      '{{Activity.CreatedAt}}'>='2016-07-13 20:00:00' AND '{{Activity.CreatedAt}}'<'2016-07-15 20:00:00' AND '{{Activity.Type}}'='EmailOpen' AND ('{{Activity.Asset.Id}}' = '200' OR '{{Activity.Asset.Id}}' = '201')

       

      using the bulk api v2.0, I get

       

      {

        "failures": [

          {

            "field": "filter",

            "value": "'{{Activity.CreatedAt}}'>='2016-07-13 20:00:00' AND '{{Activity.CreatedAt}}'<'2016-07-15 20:00:00' AND '{{Activity.Type}}'='EmailOpen' AND ('{{Activity.Asset.Id}}' = '200' OR '{{Activity.Asset.Id}}' = '201')",

            "constraint": "Must contain an expression that filters by exactly one {{Activity.Type}}. Found 1. Found {{Activity.Type}} expression within OR statement."

          },

          {

            "field": "filter",

            "value": "'{{Activity.CreatedAt}}'>='2016-07-13 20:00:00' AND '{{Activity.CreatedAt}}'<'2016-07-15 20:00:00' AND '{{Activity.Type}}'='EmailOpen' AND ('{{Activity.Asset.Id}}' = '200' OR '{{Activity.Asset.Id}}' = '201')",

            "constraint": "Must contain an expression that filters by exactly one {{Activity.Type}}. Found 1. Found {{Activity.Type}} expression within OR statement."

          }

        ]

      }

       

      If I instead run the same query without the second `OR` element it works just fine.

      The filter part of the query is:

       

      '{{Activity.CreatedAt}}'>='2016-07-13 20:00:00' AND '{{Activity.CreatedAt}}'<'2016-07-15 20:00:00' AND '{{Activity.Type}}'='EmailOpen' AND ('{{Activity.Asset.Id}}' = '200')

       

      The error messages don't make a lot of sense to me. I tried to trim down the first part of the query but the `OR` clause is the one causing the issue.

      Based on the documentation, the syntax is correct and the docs show a similar example. Wondering if I'm doing something incorrectly or there is a limitation on the type of field you can use in the `OR` clause.

       

      Thanks