I have a workflow on form container with a simple XANO Post event. However in production I have some forms that are twice or more simultaneously added do the data base. I made some tests that if I double tap on the submit form button, the record is indeed added twice. How to avoid such an event? (some users are used to double tap I guess, especially on iPads)
I believe the recommended practice is to create a variable, for example “form_submitted” that you set in the workflow when you press the button. I’d also take the extra step of setting and styling a disabled state on said button, which is controlled when form_submitted=true
. Then within the button on click workflow > start by setting form_submitted
to true > proceed with your other operations and then at the very end set form_submitted
back to false.
thanks for the reply and guidance @archenia_jsanchez , should I not set form_submitted=true when opening the form (with a separate workflow)? and have the submission workflow only set form_submitted=false?
Because if I add form_submitted=true on the start of this same workflow, people that double click on the submit button could still send twice the data no?
Yes, the solution I proposed only solves for “rage clicking” because a lack of system feedback, and doesn’t stop a user from multiple form submissions.
If the goal is to block the user from submitting the same form more than once ever, then yes, I think you’re thinking about the solution correctly. On page load I’d check the database for whether a submission exists. If it exists then set the form_submitted
variable to true and update the state of the user experience and/or form accordingly. If form_submitted
is false on load, then when the form is submitted, update the variable to true, update the state of the user experience and/or form accordingly, update the backend, and maybe refresh the front end so that the page is now reflecting your backend source of truth.
Ultimately, I think this all depends on the desired user experience, and without more context its hard for me to answer. For example, one question that comes to mind is if the form has already been submitted, then under what scenario would a user have a need to go back to the form, and how does that inform the behavior of the form? Should the user have the ability to edit the form and resubmit? Should there be a read only state of the form?
Thanks for your feedback.
I did try to implement within the workflow a pass through condition + updating the form_submitted var to false at the end, but I figured out on the log panel, that when I double click on the form button, two workflow are executed in parallel, hence the condition I am trying to build does not work…
I am using XANO as a DB so will check how I can implement your solution.
Well the user only goes once a day to this form to send a record, but I looks like some users have the habit to double tap…