-
Shawn_teamAsked on May 8, 2024 at 3:34 PM
Is it possible to embed code within the form that will allow me to take the data a client enters into a particular field (short text field in this case) and then populate that unique data later in the form?
For example, lets say I have a question followed by a short text field:
What is your name? ________ (short text field)
When completing the form, they type in the name John
Now later in the form I want to use the answer they have given in that field:
Hello John (the short text field data entry). Thank you for taking the time to answer these questions. We look forward to seeing you soon.
-
Jovanne JotForm SupportReplied on May 8, 2024 at 3:59 PM
Hi Shawn,
Thanks for reaching out to Jotform Support. Yes, it is possible to get the value entered on the Short Text field and display it on any part of the form including your Thank You message. Let me show you how:
- In your Form Builder, add the Short Text fields and other fields necessary for your form.
- To get the value entered in the Short Text field, go to its Properties then click the Advanced option. Get the Unique Name since that is the variable that will contain whatever is entered on this field.
- Once done, place the Unique Name of the Paragraph field to show that the value is passed within the page.
- You can also pass the value in the Thank You page. You just need to go to the Form Settings then click the Thank You page. Place the Unique Name to display it as well.
Here is the result:
You can also check my cloned form as a reference.
Give it a try and let us know how it goes.
-
Shawn_teamReplied on May 8, 2024 at 11:11 PM
Thank you very much Jovanne! This was very helpful and worked. Here is a follow up question for you please.
When using the Full Name field option for entering a name, when I use the unique name {name} for using the data entered in a text field it gives me the full name (first and last name). Is there a way I can get the value for just the first name? Can I get a combination as well (ex. prefix + last name)?
Thank you.
-
Ruan JotForm SupportReplied on May 9, 2024 at 2:35 AM
Hi Shawn,
Thanks for getting back to us. I'll need a bit of time to look into this. I'll get back to you as soon as I can.
Thanks for your patience and understanding while we look into this.
-
Ruan JotForm SupportReplied on May 9, 2024 at 4:14 AM
Hi Shawn,
Thanks for patiently waiting. It is possible to use the Full Name element and only pass a certain field of the element by adding a Substring widget to your form and passing the Field ID from the Full Name element to the Substring Widget. After that, you can use the Unique Name of the Substring widget to use it in your form. Let me walk you through the steps:
- In Form Builder, click on Add Form Element at the top-left of your screen.
- In the Widgets tab of the left-side Panel, navigate to the Substring Widget and drag and drop it into your form. If you want to use the Prefix, First Name, and Last Name, you'll need to add a Substring Widget for each of them.
- Now, click on the Full Name field and then click on the Gear icon.
- In the Advanced tab of the Panel on the right, scroll down to Field Values and then click on the Downward Arrow.
- Next, navigate to the Field IDs field and then copy the Field ID for Prefix.
- Now, click on the Substring Widget and then click on the Wand icon.
- In the Source Field ID field, paste the Field ID.
- Next, in the Substring Start field, enter 0, and in the Substring End field, enter 20.
- Now, click on the Substring Widget and then click on the Gear icon.
- In the Advanced tab of the Panel on the right, navigate to Field Details and copy the Unique ID.
- Finally, paste the Unique ID in the field you want to use. For this example, I'm using the Paragraph element.
That's it. You'll need to follow the same instructions for First Name and Last Name too. Check out the screencast below to see my results:
I also created a Demo Form that you can check out and clone for further testing.
Reach out again if you have any more questions.
-
Shawn_teamReplied on May 9, 2024 at 11:25 AM
Boom! Got it. Thank you so much for your time Ruan. It worked perfectly.