Skip to content

docs: fix metadata attribute value filter example for 2.42+ - #1777

Open
netroms wants to merge 1 commit into
masterfrom
docs-attribute-value-filter-242
Open

docs: fix metadata attribute value filter example for 2.42+#1777
netroms wants to merge 1 commit into
masterfrom
docs-attribute-value-filter-242

Conversation

@netroms

@netroms netroms commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The metadata API filtering docs still show the pre-2.42 example:

/api/dataElements.json?filter=attributeValues.attribute.id:eq:n2xYlNbsfko&filter=attributeValues.value:eq:AFP

Since 2.42, metadata attribute values are stored as a JSONB map keyed by attribute ID (DHIS2-17482), so the attributeValues.value path no longer resolves and returns 400 E1003 Unknown path property. The supported syntax uses the attribute's ID as the property name, which the same page already describes in the filter intro:

/api/dataElements.json?filter=n2xYlNbsfko:eq:AFP

This updates the example accordingly and adds an example for matching any value with :!null.

Reported on Slack by a community member hitting the 400 on v42+. Needs cherry-pick to 2.43 and 2.42.

AI Assisted

Since 2.42 metadata attribute values are stored as a JSONB map keyed by
attribute ID (DHIS2-17482), so the attributeValues.value filter path no
longer exists. Filters on attribute values use the attribute's ID as the
property name instead.
@david-mackessy

Copy link
Copy Markdown
Contributor

it's not very intuitive - wonder was this intentional or does it just work this way by accident?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants