This tutorial requires the use of a two-way SMS gateway. Your project must be on the Pro or higher Software plan to test this out. Follow the instructions in the Messaging Beginner Tutorial to choose a gateway for your project. This gateway should allow you to do two-way messaging. The Twillio gateway supports most countries in the world, but you may have to pay an international messaging fee to use it.

Why Use Cases For Reporting Data

This tutorial is going to setup a case for each user to report activity data. (That is, each user who reports activity data is going to be a case). This is necessary for a couple of reasons:

Cases are used to trigger reminders - if we want to send an alert email if a daily report is missed, we need to have a case to store the information for that user

Cases can be associated with a supervisor (or a case owner). This allows us to send an alert to the supervisor instead of just to the case

Setting Up a Case Registration Application

We'll create an application in our project to register these cases that are used to report data.

In your project create a new application called Data Reporter Management

Update the name of the first module to set the name to Data Reporters

And then set the case type to data_reporter

Create the Registration Form

This tutorial assumes you already know how to create a form with hidden values. Rename the Untitled Form to Registration and add questions so that it resembles the following. Some important things to note:

We name the phone number question contact_phone_number. This is the name of the special case property that Messaging will look for when creating a new case. When entering a phone number here, it must include the country code. For example, for an US phone number you would enter 15551234567. For an Indian number you would enter a number like 919560196285.

We add a hidden value called contact_phone_number_is_verified with a calculation of 1. This is also needed as a case property for Messaging to know to send messages to a case.

The full definition of the form is listed below:

Question ID

Type

Label

Required

Validation

Calculate

name

Text

Name

Yes

contact_phone_number

Phone Number or Numerical ID

Phone Number

Yes

contact_phone_number_is_verified

Hidden Value

1

Save the form and configure the case management to create a new case. Save all the questions as case properties. Its important the contact_phone_number and contact_phone_number_is_verified case properties are named correctly.

This form is now setup to create a register a case that will report on their daily activity. The phone number on each case is the phone number of the user who will report data.