Chaining filters in the API

Hello everyone,

while using the standard API you can often input filters. Sadly I have only be able to use one filter per request. 

E. g.: {{baseUrl}}/portal/person/all?PageSize=50&filter=[{"CompareOp":0,"Type":0,"ColumnName":"IsInActive","Value1":"0"}]AND[{"CompareOp":0,"Type":0,"ColumnName":"IsInActive","Value1":"0"}]

Is it possible to use multiple filters in one call. If yes, how is the syntax? Can you chain them with AND or OR?

Thanks in advance

Parents
  • Hi, Lennart, 

    In my case it's been hard to find out. You can build an array of expressions if the filter type is of type Expression.

    I've been using this in my code to filter gapaccounts by domains. Something like:

    const myexpressions=[];
    this.myfilter = [{
            Type:FilterType.Expression,
            Expression: {
               LogOperator:LogOp.OR,
               Expressions: myexpressions
               
            }
          },
          ];
    myexpressions.push(
              { LogOperator:LogOp.AND,
                Operator:'LIKE',
                PropertyId: 'PrimaryEmail',
                Value: "@eprinsa.es"
              }
            )
    myexpressions.push(
              { LogOperator:LogOp.AND,
                Operator:'LIKE',
                PropertyId: 'PrimaryEmail',
                Value: "@dipucordoba.es "
              }
            )

    this.navigationState.filter = this.myfilter;

    Hth!

  • Hi juancarlos,

    thanks for the response. Unfortunately I need a solution which I can use just in the param of the API Call with postman, without writing code.

    So like {{baseUrl}}/portal/person/all?PageSize=50&filter=[{"CompareOp":0,"Type":0,"ColumnName":"IsInActive","Value1":"0"}]

    but with multiple filters.

Reply Children