How to create Unique code with each submission with the prefix of the Unique number depending on an answer of the form submitter

  • cieds
    Asked on May 9, 2024 at 4:26 PM

    Good afternoon! I am having difficulty finding a solution for a need of mine. I need to include some sort of "automatic counter" in my form that increases numerically with each submission, and establishes a text character prefix. It seems that the "Unique Identification" widget should work, but the issue is that it allows only one fixed prefix, and I would need to have the prefix alternate based on the response filled by the form respondent. For example: if I select that I am presenting a project for the "Audiovisual" call, I expect my counter to be formatted "A0001" (starting with 'A'), while I expect the counter to generate the numbering "OA0001" if I select a project in "Other Areas". It is important that the counters run independently in the numerical field, making it possible to have a project with the identification code A0001 and a OA0001, but not having more than one repeated code (with the same prefix and same numbering). Is there any solution for this?

  • Haseeb JotForm Support
    Replied on May 9, 2024 at 4:49 PM

    Hi cieds,

    Thanks for your feedback. I’ll need a bit of time to look into this. I’ll get back to you as soon as I can.

  • cieds
    Replied on May 10, 2024 at 6:22 AM

    Ok, Haseeb. I'll wait then. Thank you!

  • Haseeb JotForm Support
    Replied on May 10, 2024 at 11:56 AM

    Hi cieds,

    Thanks for waiting patiently. You can achieve this by adding the prefix in a calculation value for the single-choice properties. and can add them with the number on the Unique Field using the Form calculation widget. Doing that is easy. Let me show you how:

    1. In the form builder, click on the gear icon for the single choice properties for the option that you want to appear as Prefix in the Unique number.
    2. Under the Options tab click on Toggle on the calculations value and assign the values like thisHow to create Unique code with each submission with the prefix of the Unique number depending on an answer of the form submitter Image 1 Screenshot 50
    3. Now add a form calculation widget to your form and create a formula like this. How to create Unique code with each submission with the prefix of the Unique number depending on an answer of the form submitter Image 2 Screenshot 61 How to create Unique code with each submission with the prefix of the Unique number depending on an answer of the form submitter Image 3 Screenshot 72
    4. Here, is how it will work. How to create Unique code with each submission with the prefix of the Unique number depending on an answer of the form submitter Image 4 Screenshot 83

    Here is my cloned form you can clone it as well to have a better look at it. Here is a guide explaining how you can clone the forms.

    Give it a try and let us know if you need any help.

 
Your Answer