Querying based on list of pairs

Certified Senior Developer

Table I want to query's structure
DOCUMENT

{

docName

docDesc

color

size

priority

}

I have a list of {{ pickle.doc, blue}, { habenaro.doc, green}} I want to use to query the table with.

Is there a way to do this in a single query? My list is of the form {docName, color}, none of these combos are unique.  I could get back 20 entries and still be fine with that solution.

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    I believe it would look something like this:

    a!localVariables(
      local!docNameColors: {
        {
          docName: "pickle",
          color: "green"
        },
        {
          docName: "habanero",
          color: "blue"
        }
      },
      a!queryRecordType(
        recordType: recordType!Document,
        filters: a!queryLogicalExpression(
          operator: "OR",
          logicalExpressions: {
            a!forEach(
              items: local!docNameColors,
              expression: {
                a!queryLogicalExpression(
                  operator: "AND",
                  filters: {
                    a!queryFilter(
                      field: "recordField!docName",
                      operator: "=",
                      value: fv!item.docName
                    ),
                    a!queryFilter(
                      field: "recordField!color",
                      operator: "=",
                      value: fv!item.color
                    )
                  }
                )
              }
            )
          }
        ),
        pagingInfo: a!pagingInfo(1, 5000)
      )
    )