Is there has some api to get data value by element name?

usually DHIS2 get value by id. but its unreadable. how to get value by name?
only by sql?

1 Like

There are ways,

You may used like this,

host /api/33/dataElements?dataElementIdScheme=name&filter=name:eq:your data element name

Also this is not only way of doing this there are other ways you may explore.


Thanks,only for query? I will try whether I can post data by using this way, or event data post

Hi @linxd I did not get your question? This is for fetching for posting you need to use other API.


compose post data like this ,it cost much time and unreadable.

Using idScheme and put name in it you can place human readable value in it. However this will not work for every items.

is there a way to add org with reference parent org by name?

<![CDATA[ /pJ0C3w6gmrK/PDycFQ5yYvx/Gn4xIQAZ43p false ORGANISATION_UNIT test1 test1 false 1950-02-01T00:00:00.000 Gn4xIQAZ43p true true true true true true ]]>

Still can’t get the event query result with DE code/name, the query para can be code or name, but how the return result include DE name or code?

The dataElement name or code is available in the dataElement API endpoint, so you need to use both endpoints. By getting the dataElementID from the the events endpoint and then requesting the code/name for that ID from the dataElements endpoint.

After that concatenate the results; however, depending on your purpose, if you don’t really need to use the API but want the information then to achieve this, you might be interested in using the SQL queries?


I will do some join by myself.

1 Like