Cannot apply operator [EQUALS] to field

hi All,

I have a use case where I have two tables product and LOB. Both have rlobid as a common field. I am fetching all rlobid from product table and storing in a variable (local!pdata). Now if I am passing these id in filter for LOB table , I am getting the below error. I want to fetch names from LOb table corresponding to a given rlobid. What possibly Im doing wrong here. Attached error code. I have inserted my QE code too. Kindly help. Thanks.

a!localVariables(
  local!pdata: index(
    a!queryEntity(
      entity: cons!PLC_DSE_PRODUCT_TYPE,
      query: a!query(
        selection: a!querySelection(
          columns: a!queryColumn(
            field: "rLobId"
          )
        ),
        pagingInfo: a!pagingInfo(
          startIndex: 1,
          batchSize: - 1,
          
        ),
        
      ),
      fetchTotalCount: true(),
      
    ).data,
    "rLobId",
    null
  ),
  local!lobdata: index(
    a!queryEntity(
      entity: cons!PLC_DSE_LOB,
      query: a!query(
        logicalExpression: a!queryLogicalExpression(
          operator: "AND",
          filters: a!queryFilter(
            field: "rLobId",
            operator: "=",
            value: local!pdata
          ),
          
        ),
        pagingInfo: a!pagingInfo(
          startIndex: 1,
          batchSize: - 1,
          
        ),
        
      ),
      fetchTotalCount: true(),
      
    ).data,
    "name",
    null
  ),
  local!lobdata
)

Expression evaluation error at function a!queryEntity [line 23]: Cannot apply operator [EQUALS] to field [rLobId] when comparing to value [TypedValue[it=197,v={TypedValue[it=1,v=1],TypedValue[it=1,v=1],TypedValue[it=1,v=1],TypedValue[it=1,v=2],TypedValue[it=1,v=2],TypedValue[it=1,v=2],TypedValue[it=1,v=3],TypedValue[it=1,v=4]}]].

  Discussion posts and replies are publicly visible

Parents
  • Hi

    The variable local!pdata would be of type List of Number, you can either cast it to Number using Cast function or apply "in" operator instead of "=".

  • 0
    A Score Level 1
    in reply to Hema

    I applied cast function on local!pdata and casted it to the Number type. I am getting only the first value (name) from the LOB table. I want to fetch all the names corresponding to the rLOBID. Currently, It is showing only first LOB name. Any suggestions ?  

    below change I made:

    local ! pdata : cast(Type!Integer, index(
    a!queryEntity(
    entity: cons!PLC_DSE_PRODUCT_TYPE,
    query: a!query(
    selection: a!querySelection(
    columns: a!queryColumn(
    field: "rLobId"
    )
    ),
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: - 1,

    ),

    ),
    fetchTotalCount: true(),

    ).data,
    "rLobId",
    null
    ),

  • +1
    Appian Employee
    in reply to Shikha

    In Appian, "Integer" and "List of Integer" are considered different types. So in your case, you need to make sure it's casting to a list of integer. The easiest way to do this is to use the tointeger() function like this:

    local!pdata: tointeger(
      index(
        a!queryEntity(
          entity: cons!PLC_DSE_PRODUCT_TYPE,
          query: a!query(
            selection: a!querySelection(
              columns: a!queryColumn(
                field: "rLobId"
             )
            ),
          pagingInfo: a!pagingInfo(
            startIndex: 1,
            batchSize: - 1,
          )
        ),
        fetchTotalCount: true,
        ).data,
        "rLobId",
        null
      )
    )

  • 0
    A Score Level 1
    in reply to Peter Lewis

    Hi Peter,

    Thanks for the explanation. This worked.  I am getting a list of Names. I also used IN operator.

    One thing I need to ask , (local!pdata) has some repeated id values like 1,1,2,2,3.  So for output,I should get name1 , name1 ,name2 ,name2 ,name 3 --- this types of output. 

    But I am getting distinct LOB names (local!lobdata).

    How to include repeated value present in local!pdata and get names for that also ?  Hope You understand this. 

Reply
  • 0
    A Score Level 1
    in reply to Peter Lewis

    Hi Peter,

    Thanks for the explanation. This worked.  I am getting a list of Names. I also used IN operator.

    One thing I need to ask , (local!pdata) has some repeated id values like 1,1,2,2,3.  So for output,I should get name1 , name1 ,name2 ,name2 ,name 3 --- this types of output. 

    But I am getting distinct LOB names (local!lobdata).

    How to include repeated value present in local!pdata and get names for that also ?  Hope You understand this. 

Children
No Data