-------Updated below code--------------
Hi ,
local!data: a!queryEntity( entity: cons!TEST , query: a!query( ) ), local!dataF:index(local!data.data,wherecontains((9555),year(local!data.data.date))), local!dataH: a!queryEntity( entity: cons!HELLO, query: a!query( logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { if(rule!APN_isBlank(local!dataF.name), {}, a!queryFilter( field: "name", operator: "in", value: local!dataF.name ) )})))
By running above code i am getting below error.
Expression evaluation error at function a!queryEntity [line 80]: Cannot apply operator [IN] to field [componentId] when comparing to value [TypedValue[it=3,v=1027A]].
Why IN operator i not working inside query filter. Outside its printing correct value. What exactly its expecting ?
Can any help me on this ?
Discussion posts and replies are publicly visible
Hello Saurav
The type 3, if I am not wrong is the text. (Check it using this typename(3) )
So I am guessing the id on which you have the “in” is an integer. So if you try to pass a text on a field which is an integer makes sense getting that error.
Why this is happening? Well the joinarray resturna a text. The problem is around that.
I was trying to follow your code and seems like you took out some pieces there.
Hope this helps
Jose
typo error. Please consider id as text here
local!data: a!queryEntity(entity: cons!TEST ,query: a!query( )),local!dataF:index(local!data.data,wherecontains((9555),year(local!data.data.date))),local!dataH: a!queryEntity(entity: cons!HELLO,query: a!query(logicalExpression: a!queryLogicalExpression(operator: "AND",filters: {if(rule!APN_isBlank(local!dataF.componentId),{},a!queryFilter(field: "componentId",operator: "in",value:local!dataF.componentId))})))
Its comparing text to text only.
Jose is correct,
seems Id is integer not TEXT,
Try this
a!queryFilter(field: "componentId",operator: "in",value:tointeger(local!dataF.componentId))
we can not convert text to integer.
Id's are like "1026A"
that need to match
If both id and componentid are from the same nature, try this
a!queryFilter(
field: "id",
operator: "in",
value:local!datasubsetF.componentId
)
That only trying but giving same issue. Expression evaluation error at function a!queryEntity [line 78]: Cannot apply operator [IN] to field [componentId] when comparing to value [TypedValue[it=,v={TypedValue[it=,v=],TypedValue[it=,v=],TypedValue[it=3,v=]}]].
The error seems to say that you have something empty on the output, maybe a reject (isnull(_), local!datasubsetF.componnentId ) Can help
Or something similar
Can you please provide the whole snippet, I don’t see where the variable is created datasubsetF