Historical data values not showing on Data entry form

I’m doing upgrade of our Dhis2 instance from 2.36 to 2.40. I restored current database and everything seems to work fine although I’m having trouble loading previous data to data entry form e.g Jan 2023 data for DataSet X.
This issue seems to be specific with some DataSets.
For test purpose:
In order to ensure that database was correctly restored, I did get request on dataValueSets endpoint. The API seems to return the expected data.
Assume I have the full privileges, what could be the issue?

Hello @salad_guyo

Sorry that you are facing this issue, are you able to elaborate more on this statement, you are importing data into this datasets, you want to see the previous data which was already captured. Then when you request the data via API it’s available in the system. its a little bit confusing.


So the screenshot is from our current instance that is at 2.36. I’m able to see the data that was captured back in Jan 2024. However, when I restore the same database on a new version i.e 2.40 and try to get data for the same period, there’s no data i.e the form is blank.

To verify that data exists (just for debug);

I did a test run on dataValueSets endpoint of the new instance. Here is the test function used;

def get_data_values(org_unit,dataset,period,paging):
    params = {
        'orgUnit': org_unit,
        'dataSet': dataset,
        'period': period,
        'paging': paging
    data_values_response = session.get(f'{base_url}/dataValueSets',params=params)
    data_values = data_values_response.json()
    return data_values

This proved to return data values. My problem is I don’t get to see the data on the form like what’s happening for older version - shared screenshot.

I hope this makes it more clear @moses_mwale

This is very clear now. So possible problem that needs to be identified, misaligned period with the dataset.
I hope you were doing this upgrade in the development instance. lets try an incremental upgrade to see which version is breaking. From 2.36, do 2.37 check if the data displays in the datasets correctly, if it does go to 2.38 in that order. sometimes there are build problems

@salad_guyo Please re-run the analytics tables again for all years and also run generate tables under resource tables . Clear your cache and see

1 Like

Sorry to hear you’re having this issue! In 2.40 are you using the legacy Data entry app or the beta Data entry app?

DHIS2 Functional Design team

1 Like

What about getting the data from the API, does that also return the same values?

Could you check the Network requests that are being sent when you open the dataset and what is being returned? (Browser DevTools F12 → Network tab, open dataset, check requests)

And as @Karoline mentioned, you might want to also check the new beta Data Entry app, so we can compare if the issue is on both apps?


1 Like

Hi @Karoline,
I’m using the legacy data entry app. The beta one seems to give distorted view of the form i.e css does not seem to apply fully.
Still with the beta app there’s no data value on the form.


Thanks @Gassim, here is the output in both scenarios;

API call: Here is trimmed output when calling API (shared a python function in initial posts)

{‘dataSet’: ‘EfAWHKKrXk6’, ‘completeDate’: None, ‘period’: ‘202401’, ‘orgUnit’: ‘Xlsqe0058by’,
‘dataValues’: [{‘dataElement’: ‘vaOx9d1TIao’, ‘period’: ‘202401’, ‘orgUnit’: ‘Xlsqe0058by’, ‘categoryOptionCombo’: ‘eWRVOI0ZOVa’, ‘attributeOptionCombo’: ‘CxLdUJu03D0’, ‘value’: ‘1’, ‘storedBy’: ‘fake_email_2@gmail.com’, ‘created’: ‘2024-02-04T10:34:52.343+0000’, ‘lastUpdated’: ‘2024-02-04T10:34:52.343+0000’, ‘comment’: None, ‘followup’: False},
{‘dataElement’: ‘vaOx9d1TIao’, ‘period’: ‘202401’, ‘orgUnit’: ‘Xlsqe0058by’, ‘categoryOptionCombo’: ‘q29aKXAOkcI’, ‘attributeOptionCombo’: ‘CxLdUJu03D0’, ‘value’: ‘1’, ‘storedBy’: ‘fake_email@gmail.com’, ‘created’: ‘2024-02-22T11:00:04.788+0000’, ‘lastUpdated’: ‘2024-02-22T11:00:04.788+0000’, ‘comment’: None, ‘followup’: False},
{‘dataElement’: ‘vaOx9d1TIao’, ‘period’: ‘202401’, ‘orgUnit’: ‘Xlsqe0058by’, ‘categoryOptionCombo’: ‘jCSJdTqaJrR’, ‘attributeOptionCombo’: ‘CxLdUJu03D0’, ‘value’: ‘1’, ‘storedBy’: ‘fake_email_2@gmail.com’, ‘created’: ‘2024-02-04T10:34:52.886+0000’, ‘lastUpdated’: ‘2024-02-04T10:34:52.886+0000’, ‘comment’: None, ‘followup’: False},
{‘dataElement’: ‘vaOx9d1TIao’, ‘period’: ‘202401’, ‘orgUnit’: ‘Xlsqe0058by’, ‘categoryOptionCombo’: ‘RKtI5cZqM7k’, ‘attributeOptionCombo’: ‘CxLdUJu03D0’, ‘value’: ‘2’, ‘storedBy’: ‘fake_email@gmail.com’, ‘created’: ‘2024-02-04T10:34:54.083+0000’, ‘lastUpdated’: ‘2024-02-05T09:10:30.611+0000’, ‘comment’: None, ‘followup’: False},
{‘dataElement’: ‘vaOx9d1TIao’, ‘period’: ‘202401’, ‘orgUnit’: ‘Xlsqe0058by’, ‘categoryOptionCombo’: ‘T0MXQOklWs8’, ‘attributeOptionCombo’: ‘CxLdUJu03D0’, ‘value’: ‘3’, ‘storedBy’: ‘fake_email_2@gmail.com’, ‘created’: ‘2024-02-04T10:34:57.284+0000’, ‘lastUpdated’: ‘2024-02-04T10:34:57.284+0000’, ‘comment’: None, ‘followup’: False},

Browser inspection: response from browser inspection

{ “dataValues”: [
“minMaxDataElements”: [

I think beta Data Entry is not ready for use yet. I have experienced a few crashes when trying to use it and also it displays distorted entry form.

I tried this with no expected results.

Thanks @moses_mwale, I will eventually use incremental upgrade if everything else fails.

@salad_guyo yes sure , try incremental upgrade

Hello, my dear.

I advise you to upgrade your system step by step. I suggest upgrading from version 36 to version 37 first. Once that is done successfully, you can proceed to upgrade to version 38. After that, you can consider upgrading to version 40.2.

I recall an instance when I upgraded my system directly from version 37 to version 40, and it didn’t function properly. Consequently, I attempted a different approach by upgrading to version 38 first, and then to version 40, which resolved the issue.

This method helped me avoid any conflicts that might arise from upgrading to different versions directly.