How to get the event with dataelement code?

I want query an event, and return with : dataelement name, value,
not dataelement by id.


dataElementIdScheme : string false Data element ID scheme to use for export, valid options are UID, CODE and ATTRIBUTE:{ID}

I found this option has not work.

Hi @linxd

@linxd , would it be helpful if you use the dataElement endpoint: /api/dataElements?fields=shortName,code&filter=domainType:eq:TRACKER

As you can see I’m filtering the domainType to Tracker. It’s also possible to use the dataElement ID from your events api request /api/dataElement/[dataElementID]?fields=

I hope this helps! :pray:

I want query the event and return like :


not just the data element name alone.

Yes, @linxd, you need to create two API requests to get the data that you want from events endpoint and the other request from the dataElements endpoint and then concatenate the results.

Please see API wiki post: developers, collaborate here with API Q&As & tips you find helpful for other developers

@linxd what about this suggestion by @diallotafsir52, does it help? Please see: Querying and reading events