-
dspannu321Asked on May 26, 2021 at 5:06 PM
-
Mike_G JotForm SupportReplied on May 26, 2021 at 8:57 PM
To my understanding, you are trying to generate an Application Number constructed from the values of different other fields on your form.
If that is the case, may I suggest that you check the instructions in this guide, please?
How-to-Manipulate-Text-String-with-Conditions-and-Calculation
Please give it a try and let us know if you need any further assistance.
-
dspannu321Replied on May 26, 2021 at 9:51 PM
Hi Mike_G. Thanks For Responding Back. The solution you suggested won't work in my case as I want to manipulate string input and wan.
Let me explain how the Application Number should work.
Suppose someone fills a form with the following details:-
firstName="John";
lastName="Doe";
phoneNumber="1234567890";
// I will Show how I can do this in Java
applicationNumber="A"+String.valueOf(LocalDate.now().getYear()).substring(2)+""+LocalDate.now().getMonthValue()+""+LocalDate.now().getDayOfMonth()+""+firstName.subString(0,1)+""+lastName.subString(0,1)+""+phoneNumber.subString(6);
result of this will be "A210526JD7890"
I want to generate this from 3 fields of the JotForm form i.e. firstName, lastName, and phoneNumber.
How can I accomplish this?
-
Mike_G JotForm SupportReplied on May 26, 2021 at 10:57 PM
If that is the case, then I would suggest that you check our Substring widget.
https://www.jotform.com/widgets/substring
Reference Guide: How-to-Add-a-Widget-to-your-Form
The widget is used to get part of a string that is a value of another field.
You can also use the widget in conditions to concatenate substrings from different form field values.
-
dspannu321Replied on June 2, 2021 at 1:31 PM
Thanks, Mike_G. I was able to achieve what I wanted through your mentioned widget.