50 rows limit pulling record using API from DHIS2 (version 2.38.2)

Dear all, I would like to request a suggestion on 50 records limit in Power Bi after the system is upgraded from 2.37.4 to 2.38.2. I tried to pull three types of records (Track entities, Enrollment, and Events).
I use the following API to get data from the DHIS2 tracker. the issue is ony 50 records are pulled from DHIS2 in pulling enrollment and event data.
https://xxdomainxx/api/tracker/events.json?orgUnit=xxxxxxxxx&ouMode=DESCENDANTS&program=xxxxxxxxx&occurredAfter=2022-01-01&occurredBefore=2022-12-31&skipPaging=true

the previous version of DHIS2 is working properly. Could anyone give me advice on this issue?

1 Like

Hi @Kyawmoewai_Ngp ,
In response to your inquiry, I would suggest two things:

  1. You can completely disable paging by adding the ‘paging=false’ parameter. For example https://xxdomainxx/api/tracker/events.json?orgUnit=xxxxxxxxx&ouMode=DESCENDANTS&program=xxxxxxxxx&occurredAfter=2022-01-01&occurredBefore=2022-12-31&paging=false. Or,
  2. You can increase the page size of the data being loaded/downloaded by adding ‘pageSize=1000’ parameter. For example https://xxdomainxx/api/tracker/events.json?orgUnit=xxxxxxxxx&ouMode=DESCENDANTS&program=xxxxxxxxx&occurredAfter=2022-01-01&occurredBefore=2022-12-31&pageSize=500

For more information, check out the Documentation.

I hope our response is able to solve the issue you were facing.

With :heavy_heart_exclamation: from the Dhistance Team.

DHISTANCE.com: The Easiest DHIS2 Setup. Up and running in 5 minutes!

No technical knowledge needed! Great Support with Data Security/Confidentiality.

3 Likes

Thank you so much for your suggestion. it works properly with the following method.
https://xxdomainxx/api/tracker/events.json?orgUnit=xxxxxxxxx&ouMode=DESCENDANTS&program=xxxxxxxxx&occurredAfter=2022-01-01&occurredBefore=2022-12-31&pageSize=500

2 Likes

Hi @e4eDHIS2,

We have three stages in a tracker program: the first and second stages are non-repeatable (unique events) and the third stage is repeatable (a follow up event filled every quarter). In all these stages we have a series of data elements that are the same: we would like an API to get the values of a specific data element across all stages, including tracked entity attributes. Is it possible?

Thanks

@dmbantu
Try this API (INSTANCE-URL/api/events.json?program=PROGRAM-ID&ou=ORGUNIT-ID&ouMode=ALL&dataElementIdScheme=UID&dataElement=DATAELEMENT-ID)

1 Like

Hi @rae,

  1. Even having specified the data element ID, the result shows the specified DE and other data elements.

api/29/events.json?program=KTee9UWYivY&ou=LJX5GuypkKy&ouMode=ALL&dataElementIdScheme=UID&dataElement=vJFG4XhOccj

image

  1. I would also like to include Tracked entity attributes in the API, as the data element refers to kits distributed to beneficiaries

Thanks

Hi @dmbantu

I recommend using the latest API /tracker endpoints rather than the deprecated ones: Tracker - DHIS2 Documentation