Tracked entities instance import

how to import Tracked entities instance at once using import export app
i made export from same dhis2 server then test import

but i get

Import complete with status OK, 0 created, 0 updated, 0 deleted, 0 ignored

my json file sample :

{

"trackedEntityInstances": \[

    {

        "trackedEntityType": "nEenWmSyUEp",

        "orgUnit": "DiszpKrYNg8",

        "attributes": \[

            {

                "attribute": "w75KJ2mc4zz",

                "displayName": "First name",

                "valueType": "TEXT",

                "value": "Dahlak"

            },

            {

                "attribute": "VqEFza8wbwA",

                "displayName": "Address",

                "valueType": "TEXT",

                "value": "769 Daffodil Dr"

            },

            {

                "attribute": "zDhUuAYrxNC",

                "displayName": "Last name",

                "valueType": "TEXT",

                "value": "Selam"

            },

            {

                "attribute": "FO4sWYJ64LQ",

                "displayName": "City",

                "valueType": "TEXT",

                "value": "Mqanduli"

            }

        \]

    }

\]

}

DHIS2 Version 2.42.3.1

Hi @aalabdo

From what I know, the new endpoint /api/tracker is expecting “trackedEntities” and not “trackedEntityInstances” which is deprecated.

You could check the new API endpoint documentation to see the required fields when importing, and the expected format for the payload here:

Tracker - DHIS2 Documentation

I hope this helps.

Regards

1 Like

Which DHIS2 version are you using?

Hi again @aalabdo,

I also remember that in some previous versions of import/export App, the dry run always showed 0 for created, updated and deleted, but in commit mode, the objects were indeed created (and the counts were correct). This means you can also try either to update the import/export app and/or try to run with import mode instead of dryRun and see if objects are indeed imported.