Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

For an overview of "cases" in CommCare, see https://dimagi.atlassian.net/wiki/x/ry7Kfw. Or go back to https://dimagi.atlassian.net/wiki/x/5SbKfw.

...

This allows you to create an export of all available case types in a project space. This functionality is only available for project spaces with a maximum of 30 case types or 20 applications. The following options are disabled when downloading all case types:

  • The option to Generate a Data Export Tool config file

  • The ability to change sheet names, the sheet names will be defaulted to the case type

  • The option to select the case properties to download

  • The ability to mark sensitive data will also be disabled

Follow the below steps to set up a bulk case export

Click on Add Export and then select  All Case Types from the dropdown "Case type"

...

  • Then click on Add Export

  • Then update the fields in the "Export Settings" page and click on the "Create" button.

...

This export contains 101865 rows. Please change the filters to be less than 100000 rows.

This means that the number of rows exceeds what we're able to successfully support via the export UI. You can try to reduce the date range of the export and download in batches, or you can also add filters to reduce the number of users the export is covering.

Alternatively, you can use other methods we have available to export your Form Data in case you have a large data set. Please see https://dimagi.atlassian.net/wiki/x/BibKfw for more information on selecting tools for data exports on CommCare HQ.

Linking Parent and Child Case Data

This section will guide you through linking different levels of cases when looking at data exports.

How Cases are Linked

Child cases are linked to their parents via a special case property called parent_id. 

Every child case has a property parent_id that matches the case_id of its parent case.

Setting up an Export to include the Parent Case ID

In order to include the parent id in an export, you will need to ensure it is selected when you create a case export. More detail on case exports can be found at https://dimagi.atlassian.net/wiki/x/vCzKfw.

Overall Settings

Make sure to set your file type to Excel.

Parent Case Section

Choose Parent Cases:

...

You must then include at least row.number and case_id:

...

Matching the Parent Case in an Export

The document you download will have two tabs - the first one has case data, and the second has the parent ID for each case that has one.

...

If you want to include more detail from the parent case, you will need to separately export the parent case and use the case_id to link the data together.

Multiple Levels

If you have a "grandparent" case you will need to link the levels one at a time. For example, imagine a case structure where you have household - mother - child. In order to link the child to the household you need to first link the child to the mother, and then the mother to the household.

Application Design

You can make this type of analysis much easier by thinking about where to save key variables in your application design. For example, if your parent case type has some sort of unique ID or name, you can save that name to the child case. You can also save other parent properties to the child case.