Howdy,
1st time post.
I'm facing a particular issue with my Query Entity results. Essentially, we need to filter out (not include) inactive equipment in a nested CDT structure. The QueryEntity rule queries against an parent order and has equipment (nested CDT) numbers associated. The results return all equipment records regardless if the equipment is active or inactive. Would there be a way to effectively retrieve the order form only with active equipment?
Query Entity Expression:
a!queryEntity_18r3( entity: cons!EMS_DB_RM_UPDATE_MOTOR, query: a!query( pagingInfo: ri!pagingInfo, logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { if( rule!HAL_checkNullOrEmpty( ri!toolServiceId ), null, a!queryFilter( field: "motorToolServiceId", operator: "=", value: ri!toolServiceId ) ), a!queryFilter( field: "isActive", operator: "<>", value: false ) } ) ) )
Results:DataSubset
Hope to hear your thoughts on this one.
Much appreciated,JT
Discussion posts and replies are publicly visible
I don't have any nested CDTs sitting around to conveniently try this out first, but off the top of my head, what happens if you try something like:
a!queryFilter( field: "equipmentList.isActive", operator: "<>", value: false )
Apologies for the late response, Mike. (Holidays)Looks like Appian responds with a test output error: Expression evaluation error at function a!queryEntity_18r3: Cannot filter by field [equipment.isActive] because it is a complex, multiple, or child of a multiple data type.
Any other options to try, Mike? Thanks again.
Sorry - I'm not sure if there's any other workaround in the case where the nested properties of a CDT are lists. You could always consider doing an overly-inclusive query and then use in-process logic to loop over the results and exclude the ones you don't want returned, i suppose.
Np. Thanks Mike.
Sorry I couldn't help. My experience with nested CDTs and especially querying on them is pretty limited (partly due to avoiding them thanks to such issues as seen here), but I'm still hoping someone else here might be able to chip in with some additional insight.