I have a related sync record One to Many - Request and Watchers.
I am trying to query data from Request record but filter the data so only those requests for which the watcher is the one provided in filter is there as well as isActive should be true.
But the response i am getting back is weird. Please have a look at the attached screen for rule as well as the data.
It's returning data which doesn't seem to satisfy filter criteria. Am i missing something? please suggest.
a!queryRecordType( recordType: 'recordType!{5c74086c-d578-4cb3-bcc9-462eac05e87d}CLM Request', filters: { a!queryFilter( field: 'recordType!{5c74086c-d578-4cb3-bcc9-462eac05e87d}CLM Request.relationships.{456939a6-4ebb-43c0-9f2a-89523af6a1f1}clmRequestWatcher.fields.{72eced9d-9111-4afa-9a19-ec3dbb59e196}isActive', operator: "=", value: false() ), a!queryFilter( field: 'recordType!{5c74086c-d578-4cb3-bcc9-462eac05e87d}CLM Request.relationships.{456939a6-4ebb-43c0-9f2a-89523af6a1f1}clmRequestWatcher.fields.{30dd7a9a-a513-448d-950a-3667fb43d727}watcher', operator: "=", value: "claims.configuser" ) }, pagingInfo: a!pagingInfo(1, 100) )
Discussion posts and replies are publicly visible
Did you read this
https://docs.appian.com/suite/help/22.4/fnc_system_queryrecordtype.html#using-the-relatedrecorddata-parameter
https://docs.appian.com/suite/help/22.4/fnc_system_relatedrecorddata.html#filtering-and-sorting-the-related-record-set
Yes Stefan - I hava already looked at these documentaitons. But the response is inconsistent, as you can see it the code i provided as well as the data on which query is performed.
Objective is to limit the results returned from parent(Request) to only show result which have matching/filtering criteria satisfied in the Child(Watch) table. But when none of the child table data matches the provided filter it still returns 1 item, which is hard to understand why?
I never tried to implement this kind of reverse-query.
The code in line 12, is that your actual code? A value like "claims.configuser" seems a bit awkward.
The issue here seems to be because by default the filters parameter uses the "AND" operator, when you need to use the "AND_ALL" operator. You will have to use a!queryLogicalExpression to do so but I would say 99% of record queries with one to many relationships should use the "AND_ALL" operator. You can read more about it here: https://docs.appian.com/suite/help/latest/fnc_system_a_querylogicalexpression.html#using-the-and_all-operator but the general idea is when it comes to one to many relationships, the "AND" operator will return any record that has at least one related record that satisfies each of the conditions, whereas the "AND_ALL" operator will return any record that has at least a single related record that satisfies all of the conditions. Hope this helps!