Altering option sets

Hi everyone,

A number of data elements with a TEXT value type option set attached to them have data already collected. We want to assign a different option set (of number value type) to the same data elements. How can we make these changes and how will this affect the data that is already collected?

Looking forward to a reply

Thanks

Hi @dmbantu

I saw a similar topic a few days ago, with almost the same question: Topic - 46987

So I think the approach will be the same - you would need to modify all of your data which has already been entered to match that of the new optionset.

Caroline

1 Like

Hi @Caroline,

I have read the topic you have suggested, Must the modification of data occur in the database? I exported the data in CSV format, but I think there is no way to change the data to match the new option set in the downloaded file.

This example is from Demo

Should I change the values in the value column? By doing so and importing the file, I do not think it modifies the data to match the new option set.

Thanks

HI @dmbantu,

It would help to know how you are importing this CSV file? Is it through an API request of the Import / Export app?

If you are using the Import / Export app then first export the CSV file, update the values, and then make sure you reorder the CSV columns to be the same as the formats mentioned in the docs: https://docs.dhis2.org/en/develop/using-the-api/dhis-core-version-master/metadata.html#webapi_csv_metadata_import probably you’ll need to use the format for #webapi_csv_option_sets

When the CSV is ready with the required format and updated values, you’ll be able to import them using the Import / Export app. Using the app seems like the easiest solution other than the database.

Thanks! :+1: