DHIS2 icon

DHIS2

Interact with DHIS2 Web API

Actions18

Tracked Entity → Get Many

AI-generated

Summary

Retrieves tracked entities of a given type from a DHIS2 organisation unit via GET /api/tracker/trackedEntities, either up to a limit or all results unpaginated.

Inputs

  • trackedEntityTypeId (required) — UID of the tracked entity type; sent as the trackedEntityType query parameter.
  • trackedEntityOrgUnit (required) — UID of the organisation unit to filter by; sent as the orgUnit query parameter.
  • returnAll — When true, sends paging=false to fetch all matching entities. Default false.
  • limit — Shown when Return All is off. Sent as pageSize (1–1000, default 50). Only the page size is set, so only the first page is fetched.

Output shape

The parsed JSON response from DHIS2 is emitted as a single item per input item, because the tracker response contains neither organisationUnits, programs, instances nor dataValues keys.

The tracker endpoint's response is not split into one item per entity, so the entities sit inside the single returned JSON object (e.g. under a list key in the response). The code only unpacks an 'instances' array, which may not match every DHIS2 version's response shape. With Continue On Fail, errors are returned as an item with an 'error' message. Runs once per input item using the dhis2Api credentials.

Examples

Example 1: Fetch the first 100 'Person' tracked entities for a facility

Set Tracked Entity Type ID and Organisation Unit ID to the relevant UIDs; Return All off; Limit 100.

Example 2: Export every tracked entity of a type in an org unit for syncing

Set both UIDs and turn Return All on (paging=false).

Links

Discussion