Breaking change in dataValueSets.csv API return value

We have been using the following API for a few years to get data from DHIS2 into an external system and do further processing, which is called every hour to get incremental updates -

https://******/api/dataValueSets.csv

When it was 2.36.x - if you look at the following image, the last field in each row was ‘deleted’, which is kept BLANK (or not supplied) when the row is a new data entry, and it has a value of ‘true’ if it is a deleted value. Means, if a person enters 20 first time, and then deletes 20 and enters 30 - DHIS2 generates 3 lines - one for 20 with deleted field empty, one for 20 with deleted ‘true’ and another for 30 with deleted empty. This helps us to sync the data properly.

Picture1

Now, in 2.4, the API CSV format changed to –

Picture2

Now, the ‘deleted’ column is always present. For the deleted rows it has ‘true’, and for the rows which are new entry it has value ‘null’. And this broke the sync function.

As our data transfer function did not expect value other than ‘true’ in the deleted column - the new rows are not handled and sync started failing.

Maybe this was mentioned in version Whats New documentation. Just curious to know, was the breaking change in API intentional? Comments from the dev team will be highly appreciated.

Hello @Mahmud. Thanks for reporting this. There doesn’t seem to be a release note for the change of behaviour. An investigation is ongoing, but so far, we think that the behaviour for the ‘deleted’ column is undefined when the value is absent. I suggest rewriting the sync functionality to tolerate absent, false, and null values for the deleted column.

1 Like