What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.

  • Profile Image

    Is there a way to change the prefix based on a required field answer?

    Asked by hvi on December 29, 2014 at 05:08 PM

    Is there a way to change the prefix based on a required field answer? For example, our Product Category field has nine possible answers and we would like to use a 2-digit prefix based on which Product Category is selected.

    Or would it be easier to assign the 2-digit code to a new field based on the Category selection and append the Unique ID, thus creating a third field?

    This is a re-post of a comment on How to Add Custom Unique IDs to your Form Submissions?

  • Profile Image

    Answered by Shadae on December 29, 2014 at 06:50 PM

    Hi hvi,

    Unfortunately, it would not be possible to do either option as the Unique ID is not generated until the form has been submitted.

    There however is a work-around that you can try with conditions and calculations.

    This would allow the prefix of your ID to be determined by an option selected in a drop-down menu. The number behind the prefix would then be randomly calculated.

    You can view a sample form here: http://form.jotformpro.com/form/43626659433967 

    Would this be a suitable option for you?

  • Profile Image

    Answered by hvi on January 20, 2015 at 09:52 AM
    ?Hi. Thanks for the suggestion. I've been playing around with this. We can't use a random number because our IDs need to be Unique when we import them into our database. I assigned the 2 digit code for the prefix as you suggest in the form below and assign it to a 2nd hidden field. Then I have the Unique ID field create a 5 digit unique ID. Then when I import the form data into our database, I conjoin the two numbers. So I don't actually have the 7 digit ID we need on the form itself, but it works out.
    Thanks again for your help.
    Bobby Windmeyer
    Technical Programs Manager
    Home Ventilating Institute
    ?855.HVI.VENT (855.484.8368) Ext. 103
  • Profile Image

    Answered by Shadae on January 20, 2015 at 10:59 AM

    Hi hvi,

    You are most welcome, I am happy to hear that you have found a suitable alternative.

    Please feel free to contact us if you need further assistance.

    Thank you for using JotForm!