We have relationship configured between two tracker programs. When we use this tracker program in Line Listing reporting, we are able to configure all the fields but not the relationships. How can we download the tracker entity instances with their relationships as well in some kind of report.
Relationships are not currently supported in the Line Listing app. This is a feature request, you’re welcome to share more about the use-case … please see ideas then create the idea and share the link here!
Just to note that the docs shared by Gassim will give you aggregated analytics outputs based on the related entities of single TEI, such as “average age of children” for all child records linked to a mother record in a child health program.
I take your request to imply youd like a line list of all TEIs for a program and their related entities. This is only available in the API (docs here).
Youd need:
UID of “From” program – you want all relationships from this program
UID of Org unit – you want all relationships for TEIs registered underneath this level
[Optionally you can also add filters for date TEI created, etc]
For example you can see the query below which you can also load in the browser. To see a relationship array outputted, add one to the Child Program on the 2.42.4 play instance.
Please note that as the documentation states there are periodic changes with the new api/tracker endpoint so you may need to adjust parameters according to your version, use old `api/trackedEntityInstances endpoint, or add new pagination.
From here you can extract and transform into a tabular CSV format.