Feature: Send notification on new submission

Quick intro, in my company, we are using ODK for creating and managing surveys, and it’s working great. However, we also have our own database where we import information from the ODK database.

Currently, we check if there were submissions in ODK within a specific time interval. This method is inefficient because we often check even when there are no submissions, resulting in no results 98% of the time or more.

What high-level problem are you trying to solve?
The main goal of this feature is to receive a notification in the form of a webhook when a new submission is created.

Additionally, webhooks could be mapped to other events, such as when a new draft is created. However, this would add significant complexity to the implementation.

Any ideas on how ODK could help you solve it?
We propose that ODK sends a POST request after a submission is successfully created, to a specified destination. This part could be managed here (though not necessarily):
ODK Central Backend Code

To implement this feature, we would need to:

  1. Define the location where the POST request should be sent, requiring a new record in the database.
  2. We would need a frontend interface to input the webhook. We suggest creating an additional tab on the system page with a form for managing webhooks.

One last mark, we would use this as global feature, not tied to any specific user.

If you have some familiarity with Python, you can use pyODK to write a script that sends emails on new submissions that meet your criteria.

If you aren't yet comfortable with Python scripting, you can use Zapier's drag and drop user interface to build an integration to send emails on new submissions to ODK. Zapier will likely be free if you aren't getting lots of submissions.

Would either of these approaches work for you?

@yanokwa Thank you for the reply. Unfortunately, Zapier is not an option for us as we would surpass the free tier within a week. And for pyODK you would suggest to create a script that checks for new submissions with a time interval and if there are new submissions send a notification? We are already doing that and that does not help us.

Why isn't the script helping you? My assumption is that it checks and only emails if there are no new submissions. Is the problem that it's not correctly reporting when there are new submissions?

@yanokwa Because we want to transition from:

  • checking if there are submissions at a set interval which results in no action most of the time since we are checking every minute
    To:
  • receiving a notification (POST request) from ODK and only doing the action when it's needed

We have implemented the first scenario and it's working. However, we want to set of the action right on the submission and also not be checking for no reason.