SELECT * FROM TABLE_A A JOIN TABLE_B B ON A.ID=B.A_ID WHERE B.ROLE IN ('ROLE1','ROLE2') and B.IS_ACTIVE=1
The relationship between A and B is one-to-many, two conditions should be matched in one row
I tried to do
{
queryfilter(Conditon1),
queryfilter(Condition2)
}
But it returned record A with two record B that match one of the conditions each
Discussion posts and replies are publicly visible
Please use https://docs.appian.com/suite/help/24.3/fnc_system_relatedrecorddata.html and your problem should get solved
Create a relationship between recordA and recordB as one to many.
Use the recordB field in the filter
queryFilter( field: recordA.relationships.recordB.fields.A_ID, operator: "IN". value: {"ROLE1","ROLE2"} )
If you want to apply filter on TABLE_B would recommend use relatedRecordDataHave a look at this example:https://docs.appian.com/suite/help/24.3/fnc_system_relatedrecorddata.html#only-return-customer-cases-that-have-a-status-of-%22critical%22
You can can try in the following way:
a!queryRecordType( recordType: recordType!A, fields: {}, filters: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: recordType!A.relationships.B.fields.city, operator: "in", value: {"New York", "Chicago"} ), a!queryFilter( field: recordType!A.relationships.B.fields.isActive', operator: "=", value: true ) } ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 100 ) ).data
I tried but this also return record A with emply list record B like following, which make the result count large and reach the paging limit, even if I want to filter the record A with valid record B, I can only filter from the maximum 5000 result
May be condition does not match for id:16.Can you validate that?Looks like for id:17 it worked.
Thank you for your help! But I don't think this is applicable for user filter, I decide to configure custom field to do this
Ohh cool great approach.
You can use a!queryLogicalExpression()