Updating Cases using Excel File

In order to update cases using an Excel file, we recommend that you follow these steps:

Step 1: Determine which cases to update

To update your cases the first step is to determine which cases to update. To do so you need to use a unique ID so that CommCare can identify your cases. You have two options to do so:

Options to determine which cases to update

Steps to follow

Options to determine which cases to update

Steps to follow

Option 1: Use the CommCare case export feature to download your cases and update them (https://dimagi.atlassian.net/wiki/x/vCzKfw ). CommCare generates a unique ID for each case and stores it in a property called case_id.

  1. Download your cases and make a case export, making sure you include the case_id column.

  2. Remove any cases that you don't want to change

  3. Remove any columns that you don't want to change/update

  4. Update the data in the columns that you want to change

  5. Add new columns for any new case properties you want to change

Option 2: If you already imported these cases using a unique ID (https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143945989 ), you can use this ID to update the cases.  For example, you may have used household number as a unique ID for importing cases. 

  1. Include your existing Unique ID column in your Excel document

  2. Add columns for other case properties you want to change or add.  You do not need to include all columns for the case, just the ones you want to update or add. 

Two example tables are shown below, one that using a downloaded case ID (option 1) and another that uses an existing Unique ID (option 2). 

Option 1: No Existing Unique ID:

name

is_pregnant

high_risk

info.case_id

name

is_pregnant

high_risk

info.case_id

Amelia Sagoff

no

yes

bcf3df0a-d19e-4701-86de-88f005aa258b

Andrea Fletcher

yes

no

4ddba071-7b1e-433d-871b-c6d9c89fc390

Jeremy Wacksman

no

no

b09bd9e8-cd9a-4a86-b14d-d0ac99d9a47a

Sheel Shah

yes

no

8bb2e7ad-d098-4929-a67f-1d8df22e9be5

Option 2: Existing Unique ID (household number)

name

is_pregnant

high_risk

household_number

name

is_pregnant

high_risk

household_number

Amelia Sagoff

no

yes

AS4398

Andrea Fletcher

yes

no

AF3933

Jeremy Wacksman

no

no

JW4380

Sheel Shah

yes

no

SS6654

Note

To update the value of an existing case property to blank/null, make sure to include at least one property in the sheet that is not null.

One way to accomplish this is to have a last column called "name" with a copy of the current cases' names. This will not change the names of the cases – since it should be the same as before – but it will force the upload to recognize and set the null values.

Step 2: Determine if updating data for a single case type or for multiple case types

Commcare has the option to update a single case type or multiple case types for example in a single upload case for household and household_member can be updated.

Next: