getodk / roadmap

ODK is an open, inclusive, meritocratic, and consensus-based project. Anyone can help set the direction of this project and these documents describe where the project is headed. ✨🗺✨

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Collect: Send submissions via SMS

lognaturel opened this issue · comments

Here's my proposal....

A form designer specifies an SMS prefix (essentially a form ID), delimiter (defaults to space) and SMS number in the XLSForm. The designer also optionally specifies a short name (also known as a tag) for each question whose answer will be sent via SMS. This short name would be a new column in the XLSForm.

For example, the designer could have a form (prefix: F123, number: 555-5555) that asks for name (tag: +N), gender (tag: +G), and age (tag: +A). Enumerators fill this out like any other form in ODK Collect.

When the enumerator finalizes the form, Collect splits the finalized form into chunks of 160 characters. When the enumerator hits send, Collect sends every chunk over SMS to 555-5555. Once Collect is sure all the SMSs are sent, it marks the form as sent via SMS.

https://developer.android.com/reference/android/telephony/SmsManager.html suggests we can split, send the message, and wait for the message sent intent to fire. I propose we wait for 5 minutes for the sending (inspired by Android’s messaging app https://android.googlesource.com/platform/packages/apps/Messaging/+/master/src/com/android/messaging/util/BugleGservicesKeys.java#69) and say the sending has failed.

The submissions will look like this.
F123 +N JOHN DOE +G M +A 35
F123 +N JANE SMITH +G F +A 26

Note that the data will not go to Aggregate! Instead, they will go to an SMS endpoint (perhaps set up via TextIt) to receive that data. And from there, users can do whatever they want with that data (perhaps send it to Google Sheets via Zapier).

I propose we add a new Server type for SMS only campaigns. You can set a device specific number in this setting which can be overridden in your form (same as Aggregate server URL). Also we can add a “Get Forms From” option (choose from Aggregate or Google or other) for folks to fetch their form. Note that this Server type will only allow submissions of forms that specify an SMS prefix.

With this proposal, an enumerator can switch between sending over SMS and data by changing the server type in the settings (if that isn’t locked down by an administrator

Available in Collect v1.16.0.