Skip to main content
August 21, 2023
Solved

how to define List of LogicalExpressions in query Record

  • August 21, 2023
  • 8 replies
  • 0 views

I need 5 logical expressions inside the query record and each operator will have different values between AND/OR.

    Best answer by mathurambm639546

    Or you can try the below logic:

    a!queryRecordType(
      recordType: "RecordName",
      fields: {},
      filters: a!queryLogicalExpression(
        operator: "AND / OR / AND_ALL",
        logicalExpressions: a!forEach(
          items: "ruleInput",
          expression: a!queryLogicalExpression(operator: fv!item.operator, filters: {})
        )
      )
    )

    8 replies

    stefanhelzle0001
    Brainy
    August 21, 2023

    Hm ... what exactly is your question? In Appian, we create lists using curly brackets {}.

    hemap0003Author
    August 21, 2023

    As per the documentation  we can provide only a single logical expression or a list of query filters.

    But I have a requirement 

    a!queryRecordType(
    recordType: RecordName,
    fields: {},
    filters: a!forEach(
    items: ruleInput,
    expression: a!queryLogicalExpression(
    operator: fv!item.gate,
    filters: {
    a!queryFilter(),
    a
    !queryFilter(),
    a!queryFilter()
    }

    stefanhelzle0001
    Brainy
    August 21, 2023

    True, but a logical expression can take a list of logical expressions.

    docs.appian.com/.../fnc_system_a_querylogicalexpression.html