Cannot apply operator [EQUALS] to field [type] when comparing to value [TypedValue[it=103,v={Text,Decimal,Date}]].

if(
  isnull(ri!type),
  {},
  a!forEach(
    items: a!queryEntity(
      entity: cons!POINTER_TO_DSE,
      query: a!query(
        filter: a!queryFilter(
          field: "type",
          operator: "=",
          value: ri!type 
        ),
        pagingInfo: if(
          isnull(ri!pagingInfo),
          a!pagingInfo(1, - 1),
          ri!pagingInfo
        )
      ),
      fetchTotalCount: true
    ),
    expression: if(
      ri!type = "Text",
      updatedictionary(fv!item, { textField: true }),
      if(
        ri!type = "Decimal",
        updatedictionary(fv!item, { decimal: true }),
        if(
          ri!type = "Date/time",
          updatedictionary(fv!item, { dateTimeField: true }),
          if(
            ri!type = "Integer",
            updatedictionary(fv!item, { integer: true }),
            if(
              ri!type = "Date",
              updatedictionary(fv!item, { date: true }),
              if(
                ri!type = "Boolean",
                updatedictionary(fv!item, { boolean: true }),
                null
              )
            )
          )
        )
      )
    )
  )
)

Rule inputs are ri!type (text, array) and ri!pagingInfo

Expression evaluation error at function a!queryEntity [line 5]: Cannot apply operator [EQUALS] to field [type] when comparing to value [TypedValue[it=103,v={Text,Decimal,Date}]].

I keep getting the error above after I set type to: {"Text", "Decimal", "Date"}

The idea is after a user choose the type of field, a boolean field is flagged when conditions are met. It should be possible to make n types of field.

Can anybody fix this? Thanks!

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to filipb0314

    What Ujjwal said makes sense to me. You must have applied it in the wrong way. Added Ujjwal's block to your code.

    if(
      isnull(ri!type),
      {},
      a!forEach(
        items: a!queryEntity(
          entity: cons!POINTER_TO_DSE,
          query: a!query(
            filter: a!queryFilter(
              field: "type",
              operator: "in",
              value: ri!type 
            ),
            pagingInfo: if(
              isnull(ri!pagingInfo),
              a!pagingInfo(1, - 1),
              ri!pagingInfo
            )
          ),
          fetchTotalCount: true
        ),
        expression: if(
          ri!type = "Text",
          updatedictionary(fv!item, { textField: true }),
          if(
            ri!type = "Decimal",
            updatedictionary(fv!item, { decimal: true }),
            if(
              ri!type = "Date/time",
              updatedictionary(fv!item, { dateTimeField: true }),
              if(
                ri!type = "Integer",
                updatedictionary(fv!item, { integer: true }),
                if(
                  ri!type = "Date",
                  updatedictionary(fv!item, { date: true }),
                  if(
                    ri!type = "Boolean",
                    updatedictionary(fv!item, { boolean: true }),
                    null
                  )
                )
              )
            )
          )
        )
      )
    )

Children