Whether you are a public health official, healthcare personnel or human resource manager, you can use CovidSafe to broadcast public service announcements of interest to users with the app within a bounded geographic region.
Here is a quick video (0:47) demo showing what this script enables.
The instructions below describe how to set up the demo so that you can submit a message through the form, which then gets uploaded to a server, and which also results in an email confirmation.
Here is the read-only Google Form template used for the demo:
Below are steps to recreate the demo:
- Make a copy of the above Google Forms sheet by going here
- Navigate to the spreadsheet backing the Google Form (where all the responses are submitted to)
- Click Tools > Script Editor
- Copy in the example script
- Modify the script as necessary:
- You can add your own API endpoint that the messages are sent to.
var url = 'https://csapi.azurefd.net/api/Messages/AreaReport';
- You can add an email address to receive immediate confirmations when someone has made a submission with the Google Form
MailApp.sendEmail("covidsafe.uw@gmail.com",...
- You can specify a map of districts, where each district corresponds to a latitude, longitude and radius in meters
coords={ "Atlantic":[0,0,0], "Ballard":[0,0,0],...
You may want to change these values to your current physical coordinates to see the notification on the CovidSafe smartphone app.
- In the script editor click Edit > Current project triggers
- Add a trigger
- Select the 'work' function to execute
- Event source: from spreadsheet
- Event type: On form submit
- Try submitting information through the form. Check your email for confirmation and check your project triggers to see they have been executed on form submission.
- Clone the CovidSafe Android repository, make sure to set DEBUG to true and pull down on the home page to refresh. You sould now see your broadcast messages. You will only see notifications from the server that you have not already seen on your smartphone.