-
WannerooMensShedAsked on July 1, 2025 at 1:23 AM
-
Bojan Support Team LeadReplied on July 1, 2025 at 1:55 AM
Hi WannerooMensShed,
Thanks for reaching out to us for help. Regarding your question about generating a Unique ID in the format YYMMMnnn where YY is the current year (2 digits), MMM is the month name (3 characters), and nnn is a unique increasing number, the current Unique ID widget in Jotform has some limitations.
The Unique ID widget allows you to set a prefix, use sequential values for the unique part, and define the number of digits for the numeric portion. However, it does not support dynamic text like the current year or month name directly within the widget settings.
Here’s what you can do:
- Use the Unique ID widget to generate the sequential number part (nnn) with your desired number of digits.
- Add a separate field (such as a Short Text Entry) to capture the current year and month name dynamically using conditional logic or calculation widgets, but this requires some manual setup or custom scripting outside the Unique ID widget.
- Combine these values in an email notification, Thank You page, or PDF using field references and custom text to display the ID in your desired format.
The first step would be to include Unique ID Widget to your form:
- Open your form in the Form Builder and click Add Element button from the left.
- Choose Widgets tab from the left panel.
- Search for Unique ID widget.
- Click or drag the widget to your form to add it.
After this, let's add a date field:
- Still in the Form Elements panel, choose Basic tab and click or drag Date Picker field to add it to your form.
- Click on the Gear icon next to the date field.
- From the right panel, choose Options.
- Set Default date to Current.
To make everything works, we would need Form Calculation widget. You can follow steps provided to include Unique ID Widget, and add Form Calculation widget the same way. After you've added it, here's how to configure it:
- Click f(x) button to add calculation formula.
- Search and click on Date String to add it.
- Ensure your click between parentheses, and click Add field.
- Choose the date field, and click Save.
The next step is to extract the Month and Year from this calculation field. For this, we need field ID:
- Click on the Gear icon next to the calculation field.
- Choose Advanced tab.
- Scroll down and expand Field Details section.
- Copy the Field ID of the field.
After this, you need to add two Substring widgets. You can follow previously provided steps to see how to add widgets. This time, you'll need to search for substring, and add two of them. After you've added them, here's how to configure them:
- Click on the Wand icon next to the first Substring widget.
- In the Source field ID, paste previously copied field ID.
- For Substring start, add 4.
- For Substring end, add 7.
Do the same for the second widget. For Substring start, you should add 13, and for the end 15.
Finally, we need to join all this information. Add new Calculation field, and include Unique ID and two substring widgets in the calculation. Don't forget to click on the gray 0-9 and make them brown A-Z:
You can hide all these field by right-clicking on them to hide them from the user. I've created an example you can test here. Feel free to submit it, and you'll see the unique value on the Thank you page. You can also clone it to see how it was created.
Give it a try and let us know how it goes.