legacy-knowledge-base
公開されました Sep. 10, 2025

Filtering objects by their NestedFields.

written-by

Julián Vela Cubas

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

Issue

  • Having a relationship between two objects A and B.

    It is possible to make queries to the /o/c/as api filtering by a field of object B as nestedField.

curl -X 'GET' \ 
'http://www.localhost:8080/o/c/as/?filter=aB%2Ftext eq 'BBB' &nestedFields=aB' \
-H 'accept: application/json' \
-H 'x-csrf-token: 8LHnmePz'

 

but filtering from the child perspective in the hierarchy (/o/c/bs) seems not to be possible:

curl -X 'GET' \ 
'http:/www.localhost:8080/o/c/bs/?filter=r_aB_c_a%2Ftext eq 'AAA'&nestedFields=r_aB_c_a' \
-H 'accept: application/json' \
-H 'x-csrf-token: 8LHnmePz'
Error: response status is 400
{
"status": "BAD_REQUEST",
"title": "A property used in the filter criteria is not supported: r_aB_c_a/test eq 'AAA'",
"type": "InvalidFilterException"
}

Environment

  • Liferay DXP 7.4+

Resolution

  • In this case the issue is that the filter expression is not the correct one for the bs part. From the API perspective, the relationship name is the same from both sides of the relationship, so, to make queries from (/o/c/bs) you have to use the “same” expression as from /o/c/as:
http://www.localhost:8080/o/c/bs/?filter=aB%2Ftext eq 'AAA' &nestedFields=aB

 

 

did-this-article-resolve-your-issue

legacy-knowledge-base