Skip to main content
stephenk0001
August 24, 2023
Solved

In a queryEntity expression, is it possible to filter on both a primary entity and a related entity?

  • August 24, 2023
  • 3 replies
  • 0 views

Here is a very rough ERD:



Each case has many subcases; each subcase deals with a software and each software has a status 

I have a Rule Input "dcmCaseID" that is populated with the parentCaseID for the Case entity.

When the query is run, I get data for all the subcases that are linked to the case ID

The query looks something like this:

a!queryEntity(
entity: cons!DSE_SUBCASE,
query: a!query(
logicalExpression: a!queryLogicalExpression(
operator: "AND",
filters: {
a!queryFilter(
field: "case.parentID",
operator: "=",
value: ri!dcmCaseID
)
},
ignoreFiltersWithEmptyValues: false
),
pagingInfo: a!pagingInfo(startIndex: 1, batchSize: - 1)
),
fetchTotalCount: false
).data,

I need to modify the query to return only subcases where the software statusID is null.

Using a queryRecordType either breaks the process completely, or returns no subcases at all.

Any help will be greatly appreciated!

Blessings

Stephen

Best answer by mikes0011

You would simply include multiple a!queryFilter() entries in your logicalExpression's filters list.

Also:

3 replies

mikes0011
mikes0011Answer
Brainy
August 24, 2023

You would simply include multiple a!queryFilter() entries in your logicalExpression's filters list.

Also:

The Expression Guru
stephenk0001
August 29, 2023

Thanks Mike, that did the trick!

mikes0011
Brainy
August 29, 2023

Cool, thanks for confirming!

The Expression Guru