Limit submission by submission ID
-
We would like to limit the submission of a form to one submission only.
This should be done independently of a user ID, but based on the submission ID, which is already taken as pre-populate and added in the new form (as an order number). Once submitted no one else should be able to submit the same form with the same order number.
Thanks a lot
-
I hope you’re well today and thank you for your question!
Currently such feature is not there “out of the box”. I’m assuming that it may, possibly, be doable with a bit of additional code but to be able to tell for sure, I would need some more information as I’m not quite sure about the goal here.
I understand that there are multiple forms and each of them should be submitted only once. Each such form reads query var which is some order number and based on that it should be possible to submit it or not.
But I’m not sure exactly:
– what that number is (you mentioned submission number but they aren’t “unique per form” – that’s continuous numbering that it maintained and continued across all the forms)? so is it some custom generated number?
– if it’s a custom number how it’s generated and where it’s stored?
– or is it that that number (order number) is form some other plugin like e.g. WooCommerce?
– if yes, it’s stored in some specific field of the form, right?
– or is it just a single form, number generation is not related to submission but is stored in submission and then the form should be submitted or not – depending if that particular number was already used in submission previously?
I understand that I may be “messing up” a bit here but to look into possible custom code we’d need to know exactly what should be checked and how, precisely, should it work so if you could throw some more light on it, it would be super-helpful!
Best regards,
AdamHi Adam @wpmudev-support8,
first of all, thank you very much for the quick feedback – great service!For me it is about the following:
1) Customer submits a form to me to get a tutor in law classes.
2) Upon submission of the form, an email is sent to all tutors to confirm acceptance of the student. This email also contains the submission ID (continuous with each student) and a link to a (new) acceptance form.
3) As soon as the tutor opens this acceptance form, the submission ID from step 2) (which I call “order number”) is already entered (pre-populate). The tutor only has to enter his name and email address in the other fields:
4) This last fourth step is my goal and problem:
This form with exactly this submission ID (“order number”) should only be able to be submitted once, so that the student can only be accepted by one tutor and the other tutors see that the order has already been placed elsewhere.– Since you could not use a limit in this regard I had the following idea:
(a) I put the pre-selected (pre-populate) Submission ID (“order number”) into a “Select” field with only one option, namely the Submission ID.
(b) For this option I set a limit of 1.
(c) The idea: As soon as the tutor accepts the order with the submit button, the form is used up and other tutors cannot accept the order for this submission ID with the link in the email address.
(d) But since the submission ID (=option in the select field) is different again when a new submission is received, this submission can be accepted again by another tutor.To this end, my goal is to have the above Submission ID already pre-selected as an option when the tutor calls the acceptance form and the form can only be submitted once. With a new assignment this should then start all over again.
I hope that you could understand the steps and I think that this would be a very helpful function.
I am very grateful for your help and wish you a pleasant day.
Hi @thankssforhelp,
Thank you for the brief explanation, but we might need a few more clarifications.
1) Can you please confirm if the Submission ID used is Forminator default Submission ID?
2) Can you please explain how you added this submission ID to the notification email mentioned?Can you please export the first form you mentioned so we can take a closer look at this? You can share the export using Google Drive or DropBox in plain text. Please find more details here: https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export
We look forward to hearing back from you.
Kind Regards,
Nebu JohnHello Nebu John @wpmudevsupport14 ,
thank you very much for your feedback.
Re 1): Yes, I confirm that the submission ID used is Forminator default submission ID.
Re 2) In the email notifications of the first form (Link to the form where we review applications: https://drive.google.com/file/d/12fCLgvVZfSEa0wKAqTxlDCmjSGlnP7Zl/view?usp=sharing), I have specified the emails of the Lecturers. Thus, the following email goes out:
“Dear lecturers,
If you want to accept this job, you can confirm this via the following link and you will receive all further information:
https://examplepage.com/applicationcheck-orderconfirmation/?ordernumber=BCK{submission_id}/“
Thus, in the new form that the Lecturer opens via this link, the {submission_id} of the first form should be copied.
This second form looks like this: https://drive.google.com/file/d/1vibca5AGiVyYesGkrZzbjoXdO2BK7_4P/view?usp=sharing
As already described above, the goal is that the {submission_id} automatically ends up in the selection field where I have set the submission limit to 1.
So only one Lecturer can accept this job, after that it should appear: “This job has already been accepted by another Lecturer. Stay tuned, there will be a new job soon for sure!”So if a new job with new {submission_id} is received, this new job should be able to be accepted again, since the selection field should change with each new job.
An alternative to the whole problem would be to work with the option Lifespan of Forminator and to set the Submission Limit to 1. But then it should be possible to set the limit back to 1 with every new {submission_id} – here you would probably have to program something again?
Kind regards and thanks for help
Hi @thankssforhelp,
Thank you for briefing the use case in detail.
I see that you are passing the subscriber ID in URL as a parameter. You can use the Pre-populate option under the Settings tab of the select field to receive the submission ID on the second form. Please check the following documentation: https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#pre-populate-form-field-values
Further, you can try a workaround as in the following link: https://gist.github.com/wpmudev-sls/a516633a168dd4d5c9bc9cdab2e4cc9d
You need to change the $your_unique_field_name with the select field ID in the above code.
I hope that helps. Please give it a try.
Kind Regards,
Nebu JohnHi Nebu John @wpmudevsupport14 ,
thank you very much, with the code it worked great.
I replaced $your_list_forms = [123,456] with my form ID in the square brackets and $your_unique_field_name = ’email-1′ with the field ID for the “order number” (which is the submission ID from the first form), which should only be able to be submitted once.
This way the more complicated way using the selection field was no longer necessary.
Kind regards
- The topic ‘Limit submission by submission ID’ is closed to new replies.