Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!
The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.
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
filipb0314 said:I keep getting the error above after I set type to: {"Text", "Decimal", "Date"}
What do you mean by this?
"Rule inputs are ri!type (text, array) " in case of array use 'in'
a!queryFilter( field: "type", operator: "in", value: ri!type ),
This is the error I get: Could not cast from Text to QueryFilter. Details: CastInvalidCould not cast from Text to QueryFilter. Details: CastInvalid
I test with those values
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 ) ) ) ) ) ) ) )
I changed it and now I get: