How to add 'like' operator in a!queryFilter?

Hello all,

I would like to use queryEntity to add a filter which uses LISTAGG function in the database view.

I'm trying to add DECISION filter something like below:

select * from DB_VIEW where RECEIVED_DATE > to_date('6/1/2021', 'mm/dd/yyyy') and (DECISION like ('%Disapproved%') or DECISION like ('%Approved%'));

Now the issue is, we do not have 'like' value for 'operator' in a!queryFilter. How can I add 'like' operator to get the filtered result on a view in the Appian Report?

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Senior Developer

    a!queryEntity(
    entity: cons!ENTITY_DB_VIEW,
    query: a!query(
    logicalExpression: a!queryLogicalExpression(
    operator: "AND",
    filters: {
    a!queryFilter(
    field: "RECEIVED_DATE",
    operator: ">",
    value: now()
    )
    },
    logicalExpressions: a!queryLogicalExpression(
    operator: "OR",
    filters: {
    a!queryFilter(
    field: "DECISION",
    operator: "=",
    value: "Disapproved"
    ),
    a!queryFilter(
    field: "DECISION",
    operator: "=",
    value: "Approved"
    )
    }
    )
    ),
    pagingInfo: a!pagingInfo(1, - 1)
    ),

    )

    This will give u both Approved and Disapproved data , if you want to add filter in report have ri! parameter for decision and use "="or "includes" operator please make sure you are using same data type for comparing fields.

Reply
  • +1
    Certified Senior Developer

    a!queryEntity(
    entity: cons!ENTITY_DB_VIEW,
    query: a!query(
    logicalExpression: a!queryLogicalExpression(
    operator: "AND",
    filters: {
    a!queryFilter(
    field: "RECEIVED_DATE",
    operator: ">",
    value: now()
    )
    },
    logicalExpressions: a!queryLogicalExpression(
    operator: "OR",
    filters: {
    a!queryFilter(
    field: "DECISION",
    operator: "=",
    value: "Disapproved"
    ),
    a!queryFilter(
    field: "DECISION",
    operator: "=",
    value: "Approved"
    )
    }
    )
    ),
    pagingInfo: a!pagingInfo(1, - 1)
    ),

    )

    This will give u both Approved and Disapproved data , if you want to add filter in report have ri! parameter for decision and use "="or "includes" operator please make sure you are using same data type for comparing fields.

Children
No Data