Legacy Knowledge Base
Published Sep. 10, 2025

Issue with Missing Aggregation Fields in Account Headless API Response

Written By

Ahmed Abdin

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

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • When I use the OOTB Account object by adding a relation to a custom object that includes aggregation fields and a custom picklist field, the aggregation fields are returning as an empty string ““ from the API response.

Steps to Reproduce:

  1. Start 2025.q1.2-lts

  2. Create a Picklist with at least one entry (e.g., "Foo") from Control Panel → Object → Picklists.

  3. Add a custom field named "picklistField" of type "Picklist" to the Account object definition, selecting the Picklist created in step 1.

  4. Create an Object (ObjectA) and publish it.

  5. Create a one-to-many relation from Account to ObjectA.

  6. Add a custom field "countB" of type "Aggregation" for the relation, using the aggregation function "Count".

  7. Create an Account from Control Panel → Accounts → Accounts and note its accountEntryId.

  8. Insert a new record into accountentry_x_20095 using the noted accountEntryId and set the value "Foo" for the picklist field (picklistField_).

  9. Clear the database cache via the Control Panel → SYSTEM → Server Administration → Cache Actions.

  10. Use the Liferay API Explorer “GET” (e.g., /o/headless-admin-user/v1.0/accounts/{accountId}). The response correctly includes the picklist field with the value "Foo" and the aggregation field countB with the value "0".

  11. Delete the corresponding record from accountentry_x_20095.

  12. Clear the database cache again via the Control Panel.

  13. Re-run the API call. Now.

Actual Result: The fields are returning an empty string value ““.

Expected Result: The fields should the correct values because the aggregation reference remains.

Environment

  • Liferay Quarterly Release 2025.q1.2-lts

Resolution

    • The Aggregation Fields were never supported for System Objects "OOTB" (such as Account). This is why it is always returning 0 or empty string. A feature request is under review by the Product Team to address this case: LPD-51575
    • To check on the progress of the request, you can ask at the Liferay Ask link: https://liferay.dev/ask/questions/feature-requests

Additional Information

      https://help.liferay.com/hc/en-us/articles/360018123132-Requesting-a-New-Feature-or-Feature-Improvement
Did this article resolve your issue ?

Legacy Knowledge Base