Versions Compared

Key

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



This page contains guidance, definitions and suggestions for how to interpret the system metadata property fields in CommCare data. 

...

Types of Data in CommCare

Case vs. Form Data

In the CommCare data model, a case is anything that we track over time, while form data is any information collected about a case at a specific point in time through a CommCare form.  Ultimately form data is the source of all case data, but not all form data is case data. Here is a breakdown of the differences between the two.

Case DataForm Data
Only those data fields that are designated as “case properties”All data fields captured while completing a form in the application
Case properties are updated each time a new form is submitted (e.g. whether symptomatic)Form properties from a new submission will not change the previous submission
Case data only shows the most recent value for each case propertyForm data includes all historical information submitted using the application
Each row in a case data export is an individual caseEach row in a form data export is an individual form submission

Metadata

Another category of data is metadata: CommCare automatically assigns meta properties as needed to cases and form submissions, and can then turn around and read them. Metadata is used in CommCare to document processes such as when a form was submitted, or when a case was opened.

...

Field NameDescriptionOther Notes
userIDCommCare-generated alphanumeric ID for a particular user.
@xmlnsThis defines the URI which specifies the structure of metadata, which is http://openrosa.org/jr/xforms
@nameThe text readable name of the form.
App VersionVersion of the CommCare application used to submit the form.This number corresonds to the list of versions in the Application Builder
deviceIDThe ID of the device from which the form was submitted.This number changes if you reinstall CommCare on the same phone. This used to be the phone's IMEI code in older CommCare versions though starting CommCare 2.48, we use a completely random identifier to populate this field. This change was done to meet Google requirements for Android 10+ devices.
locationID of the relevant location
app_idUnique ID of the application
build_id

@versionVersion of the specific form.Each time you save a change, the app builder increments this version count but this doesn't update the App Version column (above) until you build and update to that version of the app. 
stateShould be "XFormInstance"
last_sync_token

partial_submissionThis should always be FALSE.
edited_onIf the form was edited, displays the system date/time of that edit
submit_ipIP from which the form was submitted.

...

Reserved Case PropertiesCase List ExplorerCase List ReportCase Data PageReport BuilderExport Case DataData Export ToolAPIData Forwarding
@case_id@case_id
Case ID
caseidcase_idcase_idcase_id
@case_type@case_typeCase TypeCase Type
case_typecase_typecase_typecase_type
@owner_id@owner_id
Ownerowner idowner_idproperties.owner_idowner_idowner_id
@status@statusStatus





case_namecase_nameNameNamenamenameproperties.case_namecase_namecase_id
date_openeddate_openedCreated DateOpened Onopened onopened_dateproperties.date_openeddate_openeddate_opened
last_modifiedlast_modifiedModified DateModified Onmodified onlast_modified_datedate_modifieddate_modifieddate_modified

closed

Case Closedclosedclosedclosedclosed

closed_on
Closed Onclosed onclosed_datedate_closeddate_closeddate_closed

closed_by_user_id


closed_by_user_id



closed_by_username


closed_by_username







last_modified_by_user_id

user_id

last_modified_by_user_username
Last Submitter
last_modified_by_user_username



opened_by_user_id


opened_by_user_idopened_by


opened_by_usernameCreated By

opened_by_username



owner_nameOwner
Case Ownerowner_name



server_last_modified_date


server_last_modified_dateserver_date_modifiedserver_date_modifiedserver_date_modified
#case/parent_id*




indices.parent.case_id

Notes 

- Any blank means the property may not be accessible from this area of the platform.

...

More information on each of these interfaces for accessing data in CommCare appears below.

Reserved Case Properties

Certain system case properties are reserved and will always be created automatically in each  application, in each form, and for each case. App builders may access these properties through the Case Management settings page for forms, as well in App Properties when building a form. Since this metadata is what the application needs to reference in order to function properly, they can be considered the official names of these properties, but may be labeled differently elsewhere (such as in exports, as seen in the above table). They are sometimes designated with an "Info” tag for their data type as depicted here.

...

These are available to the application “on the phone”, which refers to the section of the casedb database that is accessible to the user and is available to the CommCare app on their smart phone or Web Apps session. This is where a representation of each case and its metadata lives to be read and written to through the application’s XPath expressions that the app builders write in order to work with the specific XML nodes/questions available during the session.

Case Data Page

The Case List Report and Case List Explorer are two related tools to navigate the dataset from within CommCare HQ. They will allow you to access the Case Data Page and Case Changes to review any case through the CommCare back end user interface (UI). This can be helpful for quick reference and querying or troubleshooting data without leaving the Commcare UI. Data can also be “cleaned” here, meaning that corrections can be made on a one off basis. Finally, all of this data can also be downloaded using the available export buttons.

Report Builder

The Report Builder allows you to build basic web-based reports using the data collected in your application in the following formats:

...

This data can also be downloaded to CSV and Excel. View more information about the Report Builder on this Confluence help page.

Export Data

These exports are set up manually, and can be configured to display properties using their default labels in the exports header, or with modified headings. Find out more here:

And also see De-Identifying Data Exports: data fields can be manually marked as sensitive, and once configured the de-identified reports can be saved and downloaded again in the future.

A clarification on the difference between "---" and blank values in form exports can be found here.

Data Export Tool

The Data Export Tool is also called commcare-export. Based on python script filters, it provides a way to run automated updates to large datasets stored in a MySQL SQL database or a file.

The Data Export Tool manual and detailed setup instructions are available here, along with an outline of the applicable system properties in the export field reference.

Application Programming Interface (API)

This is a way to make calls to CommCare for data from another software program.

The most common use case for the case investigation and contact tracing application is for integration with laboratory systems or disease reporting systems. The API can be used to submit data into CommCare or get data in realtime from CommCare. Requesting data requires sending a request to a URL endpoint, and requesting data in batches. The two most common endpoints are “List Cases” and “List Forms.” The data which is returned in response to the request is in JSON format. 

One way to explore the format of the API response payloads is to use the API Explorer. This tool is designed for programmers to explore the data structures and data types that can be received through the API. It requires the user to have API access enabled in at least one domain. The tool will use this API permission to send and receive real API payloads using a web browser. If this tool is used on a production domain, it will return production data into the browser window. Be thoughtful when demonstrating this tool to external audiences as it can raise questions about data security. Do not use this tool to request data from a production domain while screen-sharing or presenting to an audience, unless you have specific permission and are in a HIPAA-compliant video conference session. 

Learn more about this tool at the following link.

Data Forwarding

Data forwarders are a lower touch way to manage data integrations with CommCare by relying on these set-it-and-forget-it data exchanges. The Case Data Forwarder is the one responsible for sending cases to new venues.

See the documentation on the Case Data and other Data Forwarding services here.