Multiexcerpt include macro | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
The Excel Importer is a tool for creating or updating cases in bulk. This tool will let you either create new cases, or update existing cases. (Its possible to both at the same time, but that is more advanced). This tutorial will guide you through the process of using the tool. This is an advanced feature, so please read the instructions carefully.
...
Expand | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Step 1: Determine which cases to updateTo 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:
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
Option 2: Existing Unique ID (household number)
Step 2: Determine if updating data for a single case type or for multiple case typesCommcare 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. |
Update A Single Case Type
In order to properly update the cases of a single case type, we recommend that you follow these steps:
Step 1: Setup the import file to update a single case type.
Step 2: Import the file.
Step 3: Map the Case Properties and Complete the Import.
Click below for the full instructions
Expand | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||
Step 1: Setup the import file to update a single case typeInstead of renaming the tab to one of the cases in your project when updating a single case type, use a generic name such as Sheet_1. Step 2: Import the fileYou have now created the Excel file to import and decided what unique ID to use to identify your cases. The next steps are to select the file for import and to specify the case type and the Excel column where your case ID is (so that CommCare HQ knows in which column of your Excel file the unique case ID is located). Step 2a: Select the File to uploadIn your project, go to the Data tab and select Import Cases from Excel. Select your file and click on >> Next Step. This brings you to a page that looks like this Step 2b: Determine the case identifierIf you see a different page chances are that the name of the case was used to name one of the tabs in the Excel file and Commcare will automatically consider this file as an import that updates multiple case types in a single file, to rectify this rename the tab to a name that does not match any of the cases in the project.
First, you choose the case type that you want to update. The next step is to tell CommCare HQ in which Excel column the unique ID is and what type of unique ID you're using. Follow the table below
Using Case ID (CommCareHQ Export)Using existing Unique ID (ex. household number)Make sure you don't check "Create new cases if there is no matching case". This will ensure you don't accidentally create new cases if you mistype an ID. Step 3: Map the Case Properties and Complete the ImportYou should now be on a page with the following interface: Map Excel Headers to Case PropertiesThe next step is to map the columns in your Excel document to case properties that you want to create: you basically want to tell CommCare HQ what name to give to the new case property or match the Excel column header to an existing case property. Understand in which situation you are following the table below and then complete the steps specified
Choose each Excel column you want to import and the case property you want to create or update. If you want to create a new case property, check "Create new property" and type in the name of the case property. Once you've mapped all of your Excel columns, click on the Confirm Import button. NOTE: If you're creating a new case property, following the above steps will only create the case property for the cases. It will not automatically create a case property under case management in the form builder. Check for details in Recent UploadsUpon starting an import, you will be returned to the landing page, and a new row will appear at the top of Recent Uploads, letting you view the progress of your import. Upon completion of the import, the following information will appear under details (messages only appear if the # isn't 0):
The Form IDs and Case IDs download buttons will download a list of the corresponding ids that were created for that particular upload. These can then be used to bulk update cases or forms. |
Update Multiple Case Types in a Single Import
Below are instructions for updating multiple case types in a single import. Click below for the full instructions.
Expand | ||
---|---|---|
| ||
Step 1: Setup the import file to update multiple case typesIf you are importing multiple case types, format your file so that each tab corresponds to a unique case type. Each tab needs to be renamed to the corresponding CommCare case type so that CommCare can differentiate which case type is being updated. Step 2: Select File to ImportYou have now created the Excel file to import and decided what unique ID to use to identify your cases. Next steps are 2a. select the file for import and 2b. specify the case type and the Excel column where your case ID is (so that CommCare HQ knows in which column of your Excel file the unique case ID is located). Step 2a: Upload fileIn your project, go to the Data tab and select Import Cases from Excel. Step 2b: Determine the identifierSelect your file and click on >> Next Step. This brings you to a page that looks like this CommCare will detect that there are multiple case types and instead of showing the case types it will show the label “commcare-all-case-types”, Step 3: Completing the ImportThen you should be on a page with the following interface, press confirm and the CommCare will show the result of the import. Once you press confirm, check for details in Recent Uploads Upon starting an import, you will be returned to the landing page, and a new row will appear at the top of Recent Uploads, letting you view the progress of your import. Upon completion of the import, the following information will appear under details (messages only appear if the # isn't 0):
|
...
It is possible to update or create cases with Easy References, though there are some quirks.
Click below to read more.
...
...
title | CLICK TO EXPAND |
---|
You can directly type in the case property as #case/<property_name> to reference a property that is not in the app structure but was imported via the case importer. However, if that property is not used anywhere else in your application, you will see an "Unknown question" warning. This warning will not prevent you from building and using your application. It will simply look as though there are errors with the application.
...
Click below to read more and to see the following example to remove the warnings.
Expand | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||
Set-UpFor the following steps, let's assume we have updated/imported new cases with properties sick and high_risk that were updated via the case importer:
When you go to reference these properties in a form, you may receive warnings that the property is unknown. These warnings will not prevent you from deploying and using the application. Note that you will need to enter the properties manually using #case/<case_property>. The property will appear as a yellow triangle with an exclamation point when turned into an easy reference: While those warnings do not cause any issues, they can be annoying. Let's remove them! Instructions
OptionalThere may be instances in which you do want to reference imported properties throughout the application, but you don't want your mobile workers to be able to update them. To handle this situation, perform the above steps and then add a filter to the module so that it is hidden from the mobile workers:
|
Undoing Case Imports (and other system actions)
...
"Oh no! I performed a huge case import, but now I need to roll them back. What do I do?"
Click below to read more.
...
title | CLICK TO EXPAND |
---|
Does this sound like something you've said before? Sometimes, we need to roll back system changes that we've made, whether they were done by accident or incorrectly. Thankfully, CommCare allows you to find most of these forms and roll them back by "archiving" these actions.
...
...
Warning! Do not rely on this feature as an integral part of your project workflow.
...
The below directions are only for users who need a last resort method for undo-ing system actions!
Click below to read more.
Expand | ||
---|---|---|
| ||
Finding System Forms:
|
...