TypeValue error while executing query entity

Hi Team,

Need your help to resolve the problem - 

Problem -  Getting this error while executing the query entity code - Expression evaluation error at function a!queryEntity [line 3]: Cannot apply operator [IN] to field [id] when comparing to value [TypedValue[it=3,v=1; 2]].

Query Entity code -

a!localVariables(
local!panelId:"1; 2",
a!queryEntity(
entity:cons!IM_INTERVIEW_PANEL_DSE_POINTER,
query: a!query(
selection: a!querySelection(
columns: {
a!queryColumn(
field: "name"
)
}
),
filter: a!queryFilter(
field:"id",
operator:"in",
value: local!panelId
),
paginginfo: a!pagingInfo(
startIndex: 1,
batchSize: -1
)
)
).data.name
)

  Discussion posts and replies are publicly visible

Parents Reply
  • As you are storing multiple integer values in a single text field, you can use a combination of split() and tointeger() to format correctly for the query:

    a!localVariables(
      local!pandelId: a!forEach(
        items: split(
          "1; 2", /* replace with a call to your CDT field */
          ";"
        ),
        expression: tointeger(fv!item)
      ),
      a!queryEntity(
        entity:cons!IM_INTERVIEW_PANEL_DSE_POINTER,
        query: a!query(
          selection: a!querySelection(
            columns: {
              a!queryColumn(
                field: "name"
              )
            }
          ),
          filter: a!queryFilter(
            field:"id",
            operator:"in",
            value: local!panelId
          ),
          paginginfo: a!pagingInfo(
            startIndex: 1,
            batchSize: -1
          )
        )
      ).data.name
    )

Children