Remove category options that contain data

Hi all,

I would like to know what path I need to follow to delete category options that already contain data. the data dimension is attribute combo.

Category option (Gill Marcos, Juvencio Maria, Olinda Jose, etc) - Category (Activistas) - category combination (Activistas).

it may be through a script/API or other way possible.

Thanks in advance

Hi @fernando

If I understand you correctly, you would like to delete a category option which has already been associated with a category. This may be possible, but could also be a bit tricky. Using a test instance, of your database, I would try and delete all the data values associated with the attribute option combination (which the category option is a part of) from the datavalue table. I might then just make this category option not visible to anyone so no more data can be entered into it.

Removal of category options after they have been created can be done, but I do not think it will be easy or straightforward. We have a script here which can be used to remove organisation units. I think you could use this as the basis of an SQL function to remove a category option, but as you can see, its not so simple and certainly not without risk.

Again, I would recommend that you simply remove the data, and then change the sharing on the specific category option so that no one has access to it.

Good luck!
Jason