Mandatory data sync error - App to server (Instance v.2.40.3 and App v3.0)


We have recently been testing the latest version of the DHIS2 Capture app (v.3.0; SDK v1.10.0) with the latest instance version (v2.40.3) to determine whether we can upgrade our instance without any issues.

We have a Capture program (event without registration) with some mandatory fields (e.g., species) to track vaccinations. The data capture on the app works perfectly (including an “Implementing Partner”; i.e. Cat Option Combo) thanks to the new hotfix to the app. The captured data syncs perfectly with the server.

However, the problem arises when someone edits the synced record on the app. The user is able to go into the record and change the data (for example, changing the species to another species) and can save that updated record again. But, when they try to sync that record again (with the updated information) the sync gives an error: “Mandatory DataElement “[DE code]” is not present.”

If one checks the record again, all the information is present and correct (including the data in the mandatory field).

To resolve this issue, the user has to edit the record by selecting another option in the mandatory field (any one) and then reselecting the original option. For example, if the mandatory field is “Species” and “Dog” was selected, the user needs to change the species from “Dog” to anything else (e.g., Livestock), and then select “Dog” once again. This can all be done without saving the record.

If this process is followed for all mandatory fields and then saved, the updated record is then able to sync with the server.

To resolve the problem entirely, we removed all mandatory fields from the capture program and the sync worked perfectly, even after updating the record. This also resolved any records that were currently unsynced due to the error, allowing them all to sync with the server.

Interestingly, we tested this with App v3.0; SDK 1.10.0 and Instance v2.33.10-SNAPSHOT and the error did not occur. It only occurs (in our limit of testing) with App v3.0 and Instance v2.40.3 (build revision f8428dd).

1 Like

Hello @Terence_Scott,

thanks for the detailed explanation, it made it possible to reproduce the issue in a very quick test. Could you create a JIRA ticket in the Android app with all the details you have (a link to this thread will be helpful)?

Thanks @vgarciabnz

I have created the JIRA issue: [ANDROAPP-6211] - Jira

@Terence_Scott Thanks for this note—would have been tempting for me to have the assumption that testing App v3 on an old version was == a new version, in particular with something like this that feels very android specific.