CommCare – How to Set Up Excel Import to Update Case Property to Null

commcare

I have a case property in a CommCare app that has a value for a few hundred cases. This case property should never have been set for these cases. I have corrected the app structure to prevent the issue going forward, but I also need to set the value of the properties for existing cases to null using the Excel Case Importer tool. Setting the cells to empty or "—" did not work.

How should the Excel file be formatted in order to accomplish this?

Best Answer

What you're trying to do is slightly tricky and has tripped up many of us, but fortunately it is possible!

I assume you tried to do an import with 2 columns, one for case_id with the IDs of all the cases you want to update and one for property_x, which you left blank or as "---". Unfortunately, excel importer ignores any cases where all of the values are blank or "---", so none of your cases were updated. :(

The way around this is to add a 3rd column to your import. I would make this column "name", as the name property should be non-null for every single case. The values for this column should just be the names of the cases as they are in a case export. Now when you do the import, every cases will have a non-null value to update, so the case update will not be ignored. This won't affect the name property, since you are updating to the same value that it was before, but it will update the property_x property to blank (just use an empty cell, not "---").