Hi,
Seeing the following error:
Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error in rule 'adv_getaddresses' at function 'type!{urn:com:appian:types:ADV}ADV_Address' (invalid) [line 23]: Invalid function 'type!{urn:com:appian:types:ADV}ADV_Address' due to invalid type
a!localVariables( local!locationsList: rule!ADV_getAddresses(addressId:NULL), { a!sectionLayout( label: "Address", contents: { a!radioButtonField( label: "Radio Buttons", labelPosition: "COLLAPSED", choiceLabels: a!forEach( items: local!locationsList, expression: fv!item.shippingAddress & " " & if(isnull(fv!item.unitNumber), null,"Unit#"& fv!item.unitNumber) & " " & fv!item.city & " , " & fv!item.stateOrProvince & " " & fv!item.postalCode ), choiceValues: local!locationsList, saveInto: {}, choiceLayout: "STACKED", validations: {} ) } ) } )
It calls an Expression Rule, which is as following:
a!localVariables( local!queryResults: a!queryEntity_18r3( entity: cons!ADV_DSE_ADDRESS, query: a!query( paginginfo: a!pagingInfo(1, - 1), logicalExpression: a!queryLogicalExpression( operator: "AND", ignoreFiltersWithEmptyValues: true, filters: { a!queryFilter( field: "addressId", operator: "in", value: ri!addressId ), } ) ) ).data, cast( typeof( { 'type!{urn:com:appian:types:ADV}ADV_Address'() } ), local!queryResults ) )
What could be the issue in the code? Pls kindly help!!
Thanks,Suneetha.
Discussion posts and replies are publicly visible
Says that you have an invalid type.
Are you sure that the ADV_Address type exists? Perhaps the namespace could be the issue?
'type!{urn:com:appian:types:ADV}ADV_Address'()
Yes, ADV_Address type exists..
The names are case sensitive. This is ADV_address vs. ADV_Address.
Changed it to ADV_address and now it shows another error..
Expression evaluation error at function a!queryEntity_18r3 [line 2]: Cannot apply operator [IN] to field [addressId] when comparing to value [TypedValue[it=1,v=1]].
Did you check the data types? They must match. Is there a reason you use the "in" operator?
I am currently following the exercise given in the appian course..
May be the documentation is an outdated version..
OK. What about the data types. What type is addressId? The rule input seems to be Integer.
Yes, addressId is a Number (integer) data type.
It works now.. For the test rule I was inputting 1 value to the Expression box and it was giving me the above error, when I left expression box empty.. I see all the 3 values coming from the table correctly.. I guess its the input value that I am passing in the expression box was incorrect..
Correct results when left empty expression box:
Error when entered 1 in expression box:
Thanks you Stefan for your quick response!!
Suneetha.
Unknown said:addressId is a Number (integer) data type.
The "In" operator requires the target to be an array.