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 |
---|---|
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. |
|
Option 2: If you already imported these cases using a unique ID (Creating New Cases - 1. Setup Excel File ), you can use this ID to update the cases. For example, you may have used household number as a unique ID for importing cases. |
|
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 |
---|---|---|---|
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 |
---|---|---|---|
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: