Collecting data using SMS or integrated voice response (IVR) interactions is sometimes easier, more efficient, or less expensive than sending a data collection team into the field. This feature allows you to collect data using RapidPro flows, which utilizes SMS or IVR as its mode of data collection, and push those submissions from the connected flow to a form in Ona. Once the data has been passed to Ona, you can use any of the data analysis or visualization tools on the data you collected. You can choose to use RapidPro flows, Enketo webforms, or ODK Collect to collect data, and analyze all the data collected, regardless of the data collection mode, in one location utilizing all the data analysis and visualization tools the Ona platform has to offer.
This feature will utilize both a RapidPro flow and an XLSForm built using similar field names.
To collect data using RapidPro, you need to create flows. Flows allow you to define the SMS or IVR interactions and follow-up actions with your contacts. Responses received from the interactions are passed to an XLForm connected to the flow. This form should be uploaded to your Ona account.
To create a flow in your RapidPro account, click on the flow icon, then click on Create Flow on the left side of the flows page.
A flow starts with a command that allows you to perform some action. For example, an action may be send a response message to a contact.
An action is usually followed by a response rule, which is a conditional statement that directs your contacts to the next step of the flow after evaluating the response entered. Variable names in the response rules should match field names in your XLSForm in order for data to be submitted to the form connected to the RapidPro flow. For example, if you have a field name respondent_age, then you should save your response rule as Wait for respondent_age, instead of the default rule Wait for response.
Read the RapidPro documentation site for more information on how to create flows.
Passing submissions to a form
To pass submissions to your form on the Ona platform, you will be required to call a webhook at the end of your flow. To call a webhook, select the option Make a call to an external server under actions, then click Ok.
A webhook modal will pop up, where you need to provide the URL to which data should be submitted. Select POST, then enter the URL https://ona.io/[username]/[form-id]/submission. The form-id is the last number in the URL after loading a form on the Ona platform. For example, in the URL https://ona.io/qastuff/31782/249620, the form-id is 249620.
The webhook allows you to configure RapidPro to send new submissions to your form. Each time a new submission is done, RapidPro will make a POST request to the URL you configured with the body of the POST containing the details of the submission pushing the RapidPro data to your XLSForm on the Ona platform.