When:
to
Room:
Baker (LL3)
Track:
SVG
development & coding

Collecting Data in Drupal When Internet is Unstable: Browser Local Storage and Service Workers

Collecting Data in Drupal When Internet is Unstable: Browser Local Storage and Service Workers

The High Performing Health Care (HPHC) Tool is a Drupal site that collects data from participants who have knowledge of the health care system in their respective countries. In some countries, the internet is intermittent or unstable, and users pushed back against entering data into a web-based survey (Webform). Rather than trying to manage both an online and file-based data collection instrument, we chose to build online-offline capability for our site leveraging Web APIs. To do this, we took advantage of service workers and browser local storage. This allowed users to complete the form without worrying about the internet connection. If the form is submitted while offline, the data will be stored in the browser's local storage and the user will be notified. Otherwise, the submission will proceed normally.

This presentation will start with a more detailed discussion of our initial use-case, move into a discussion about the enablers of online-offline capability (browser local storage and service workers), and then will delve into the technical details of our implementation.