How do I access the elements of a field to use for prepopulating URL?

  • Yempo
    Asked on August 2, 2019 at 10:30 PM

    Hi, I'm using the fullname field type in a form and want to prepopulate it. The field name is {name} - how do I access firstname and lastname separately? Screenshot attached. Many thanks.

    Jotform Thread 1914521 Screenshot
  • Augustine_O
    Replied on August 2, 2019 at 11:28 PM

    Hello, 


    Sorry, I think the UNIQUE NAME option is focused on the field generally, but you can access the subfields (Firstname and Lastname) right on the Full Name Properties as shown below:

    1564802728jotform0010 Screenshot 10

    1564802755jotform0011 Screenshot 21

    I am sure these options can help you work out something on individual subfields comfortably. Please, do let us know what comes up. 


    Thanks.

  • Yempo
    Replied on August 2, 2019 at 11:31 PM

    Thanks, but I need to extract them to use in a url. For example {name} can be used for prepopulation. How do I access the 2 elements of the name field in code?  If I look into your help guide:

    https://www.jotform.com/help/71-Prepopulating-Fields-to-Your-JotForm-via-URL-Parameters


    It provides this example which LOOKS LIKE it does what I want to do - eg name[first] and name[last], however this didn't work for me.



  • Augustine_O
    Replied on August 2, 2019 at 11:52 PM

    Hello, 


    Kindly hold on a little bit and a Customer Support will be with you soon. I'm sorry, I could not get my hands around this, but I'm very sure there is a way to have it fixed.

    Just stay tuned. 


    Thanks and all the best.


  • Jed_C
    Replied on August 3, 2019 at 3:43 AM

    If you are referring to this form https://www.jotform.com/92051467972463, it should be name[first] and name[last].

    ex. 

    https://www.jotform.com/92051467972463?name[first]=Steve&name[last]=Smith

    Another easy way of doing it is by using Jotform's prepopulate tool app here https://prepopulate.jotform.io/. Just fill the field with whatever value you want and click on "Generate URL". That is helpful if you have a lot of fields to prepopulate.

    1564818220prepop Screenshot 10

    I hope that helps. Let us know if you have any questions or if you need further assistance. 

  • Yempo
    Replied on August 7, 2019 at 12:50 AM

    Hi, thanks for your reply but I'm still having problems. Note that I can't use the pre-population tool, I need to build the URL on the fly.


    I've now moved the URL from the PDF to the Email as I thought it would be easier, and definitely easier to debug.


    Here is the scenario.


    Candidate fills in this form:


    On Submission, email is sent to recipient and a URL is generated that the recruiter can click on to load a new form with parameters to pre-populate. The code in the email is:


    Hi {hiddenRecruiter}, you've received a new application from {preferredName}. Click here to progress them to the next stage.


    https://form.jotform.me/92120745670454?PreferredName={preferredName}&LastName={name[Last]}



    The code in red is what isn’t working. The URL that is generated on the fly is:
    https://form.jotform.me/92120745670454?PreferredName=Michelle&
    LastName=Michelle Fiegehen



    Eg the {name[last]} is not extracting the last name from the name field.


    Thanks.


     


    https://form.jotform.me/92131177992462https://form.jotform.me/92131177992462

  • Jed_C
    Replied on August 7, 2019 at 2:24 AM

    I see what you mean. My last name was on the First name field instead in Last name field.

    1565158386Additional Information Submiss Screenshot 10

    You can replace it with the following URL:

    https://form.jotform.me/92178796637476?preferredName={PreferredName}&name[first]={PreferredName}&name[last]={LastName}&emailAddress5={candidateemailAddress}

    Sample output:

    1565158992Additional Information Submiss Screenshot 21

    1565159014Your Application with Yempo ha Screenshot 32

    Here's how it looks in your Autoresponder.

    answers Screenshot 43

    I hope the URL I've provided above helps. Let us know if you have any questions or if you need further assistance. 

  • Yempo
    Replied on August 8, 2019 at 2:21 AM

    Hi again, I'm so sorry but I still can't get this working. The URL you provided worked okay but used the wrong form. I've updated it (and simplified the form for troubleshooting purposes) but I still can't get the last name and first name to pass into the new form. (Note I can't use your prepopulation tool as I need to generate the URL on the fly.

    So this form: https://form.jotform.me/92131177992462

    Has this code in the "send to recruiter autoresponder":

    https://form.jotform.me/92120745670454?PreferredName={PreferredName}&name[first]={FirstName}&name[last]={LastName}&email={email}

    Which works if I remove the name segments, but fails if I leave it in. The URL it generates for me is:

    https://form.jotform.me/92120745670454?PreferredName=Sez&name[first]=&name[last]=&email=sarah.johnson@yempo-solutions.com

    which is all correct except the name fields. My original problem still stands - I can't seem to access name[first] and name[last].

    thanks again.

    Michelle

  • Victoria_K
    Replied on August 8, 2019 at 3:50 AM

    Here is the link, which should be correct. 

    https://form.jotform.me/92120745670454?PreferredName={PreferredName}&name[first]={name:first}&name[last]={name:last}&email={email} 

    Please note how name subfields were added to generate the link. Basically, name is the unique name, which you get from field properties, and first/last are constant values for the fullname element, you can add those to fetch values from any other fullname field. 

  • Yempo
    Replied on August 8, 2019 at 4:37 AM

    Hi Victoria, thanks for the prompt reply. I was very excited to see your code, which is different from all the other people who have tried to assist me. Unfortunately, it fails, generating this url:


    https://form.jotform.me/92120745670454?PreferredName=sez&name[first]=&name[last]=&email=sarah.johnson@yempo-solutions.com

     

    The {name:first] is still not recognized.


    Michelle

  • Jed_C
    Replied on August 8, 2019 at 5:05 AM

    It is not working because the URL you have in your "Send to recruiter" notification is different. Below is what I see in the URL.

    https://form.jotform.me/92120745670454?PreferredName=%7bPreferredName%7d&name%5bfirst%5d=%7bname:first%7d&name%5blast%5d=%7bname:last%7d&email=%7bemail%7d

    I just updated the URL in your notification so please test your form again. I just cloned your form and it's working on my end.

    ex.

    1565255101url Screenshot 10

    Let us know if you need further help.

  • Yempo
    Replied on August 8, 2019 at 7:17 AM

    Hallelujah, that works! I have had so much incorrect information along the way.  The only thing that worries me is the garbled URL you were able to see, when it looked perfect in my system.


    thanks anyway for solving this very challenging problem!