Form limit submissions PoC

Explore

Welcome to the "Form limit submissions PoC"!

ā€‹

This proof of concept demonstrates how to conditionally lock Airtable forms. Kudos to Ben Green for inspiring this proof of concept.

ā€‹

This PoC requires the following parts to work together:

  • A table (in this PoC Form input) which is populated by a form and has a reference to a view of another table (Lock view this example).
  • The other table (Form lock) with the referenced view `Lock view` which has a filter, that will result in an empty view if the lock is toggled.
  • A form (Form limit submissions PoC) for which the following query string is used ?hide_Form%20is%20locked=true&prefill_Form%20is%20locked=locked when sharing the link, ie. the query string is to be appended at the end of the sharing link. Because the Form is locked field is required, as soon as the single entry in Lock view disappears, the form cannot be submitted anymore. To hide these mechanics from the users, the form field is hidden with hide_Form%20is%20locked=true and prefilled with prefill_Form%20is%20locked=locked (please refer to the Airtable documentation for further details regarding form field prefilling and hiding).
  • An automation (Lock the form if a certain number of submissions is reached) which checks if the conditions to lock the form are met and locks the form if necessary. Note that opposed to the used trigger in this PoC, a form submission trigger would work as well. However, the version used in this PoC triggering directly on records created in the destination table might be more robust in case you have other sources adding records and you want to ensure that you enforce conditions based on the data itself instead of form submissions (if you just check on form submissions, manual entries would for example allow to exceed a limited number of entries for one submission, because the form is locked after the entry has been added).

ā€‹

Besides locking the form based on the conditions used in the automation, the form also conditionally displays a message in case the form has been locked. This is made possible by using an additional field in Form input as form element and attaching the message to it in the form. However, this has been added more for demonstration purposes and should probably not be used in production, because the initial rendering of the form currently shows the message before the visibility conditions are evaluated.

ā€‹

If this Airtable base was helpful to you, I would appreciate a coffee ā˜•ļø!

Explore
Updated August 3, 2022 at 9:56 PM
Copied 41 times

Andreas Remigius Schmidt

Senior software engineer
Explore the base
Default
Raw
Lock view
Raw