Understanding the Challenge

Mobile apps need to be more than just functional—they must be reliable, even when users are offline. This presents a significant challenge for developers: how can you ensure data collected in an offline environment seamlessly syncs with a centralized database once connectivity is restored? This was the challenge I faced while developing a FileMaker Go app that needed to operate in remote areas with limited or no internet access. To solve this, I leveraged the power of Otto webhooks, which are included with OttoFMS, to ensure that no data was lost during the transition from offline to online.

Webhooks as a Solution

A webhook is simply an HTTP request – usually a POST or GET – with a JSON payload or parameters broadcast from a system.

We decided to use webhooks to send data from the mobile devices to the server because our servers already had OttoFMS installed. What made webhooks stand out was the flexibility in managing data payloads. By using the webhook receiver, I could not only control the payloads sent from the mobile app but also customize how the data was processed once it reached the server. This level of control was essential in ensuring that the data transfer was accurate and efficient. 

Implementing the Solution

Setting up Otto webhooks with OttoFMS is straightforward and can be done in minutes. The OttoFMS webhooks guide walks you through the steps, where the key feature is Otto’s file receiver, which allows us to upload field photos to the server. This video tutorial walks you through the steps to set up Otto webhooks.

To get started, you will need to do the following: 

  1. Install OttoFMS
  2. Create an API Key for the target FM file
  3. Prepare your target file with the OttoReciever add-on
  4. Register your webhook in the OttoFMS console
  5. Test your webhook by sending a test payload (and verify you get a 200 response)

Once the webhook is set up within OttoFMS, you can send data directly from an external system (in our case, an offline FileMaker Go file) to the central server. The server will receive the data as a JSON payload and can process it as appropriate for the solution.

For JSON payloads, you can POST to the following URL:

https://[your.server.host]/otto/receiver/Database.fmp12/[channel]?apiKey=dk_01234

To upload files, you can send multipart/form-data HTTP requests to the following URL:

https://[your.server.host]/otto/filereceiver/Database.fmp12/[channel]?apiKey=dk_01234

Files are posted to the FileMaker Server’s document directory. You can learn more about it in the documentation.

One important step in the setup process is designating the FileMaker file that will receive and process the payloads. In our case, we added the OttoReceiver add-on to a hosted FileMaker file that served as the centralized destination for all data collected in the field. The destination file is also the source of user accounts for our case. When users log into the mobile file, they enter their credentials which are then used to fetch a unique Data API Key. The user’s API key is stored in the mobile file to be used for future HTTP requests. This method allows us to track records to the corresponding accounts on the receiving end.

The Process

Beyond the technical setup, there are several important design and workflow decisions to make:

  • What data is being pushed to or pulled from the destination file? 
  • How will authentication be managed?
  • How will you batch your data when sending it?
  • Are you creating or modifying records in the destination file?
  • How will users know when a record has been uploaded or synced?
  • How will you handle and identify duplicate or orphan records?

These questions require careful thought and may need to be adjusted based on your specific use case—that’s the user experience piece and should be tailored to the needs of your users. Throughout the process, I worked closely with my project manager and business analyst to gather feedback from users and refine the solution. Making these decisions can be challenging as a developer, but understanding the use case and business requirements is key.

Real-World Testing and Refinement

This project felt fully realized when it was finally tested at a remote site. Crew members collected data in the field while offline and uploaded their data to the server once they were connected to a network. Users were delighted to see the data collected by all their peers in a centralized location. Real-world testing was crucial to refining the app. 

The beauty of using FileMaker and webhooks is that you can customize how you process your payloads based on your case. You can rely on the OttoFMS file receiver to consistently receive payloads as long as the mobile device is online to make an HTTP request. I learned that when the foundational functionality works consistently, you can focus on refining the user experience. 

FileMaker as an offline solution

FileMaker Go is a powerful tool for businesses that operate in environments with unreliable or no internet connectivity. Its ability to collect, store, and manage data offline, combined with features like webhooks and integration with services such as OttoFMS, makes it ideal for industries that require remote data collection, like field operations, construction, and transportation. With FileMaker Go, users can confidently gather and store critical information without worrying about network availability. Once connectivity is restored, data can sync to a centralized database, ensuring continuity and accuracy. This flexibility empowers businesses to stay productive, even in the most challenging locations, while maintaining the reliability and customization that FileMaker is known for.