How to pre-fill a form with the previous form's responses

  • Russ563
    Asked on March 18, 2015 at 8:17 PM

    I have my form which parents are filling out to register their kids for our league.

    So they fill out the form for the first kid and submit it, then they go back and do it again for their 2nd (& 3rd) kid(s).

    Can the form stay filled with their info when they submit multiple kids?

    Is this what I'm looking for?:  http://apps.jotform.com/app/field_prepopulator

    I had thought about doing multiple kids on 1 form, but I need all the fields for each kid to import into off line software.

    Thank you

  • Steve VP of Sales Operations
    Replied on March 19, 2015 at 12:02 AM

    Hello,

    I believe this can be done. I'm still formalizing the solution. Will update this thread shortly!

    Steve

  • Steve VP of Sales Operations
    Replied on March 19, 2015 at 12:53 AM

    Hi,

    Here's instructions on how to do this. Here's an simple example form with this solution:

    https://www.jotform.com/form/50769595618977

    It uses a method for prepopulating fields which allows you to create a special URL which will prepopulate fields, described here. Please read this to understand the process. https://www.jotform.com/help/71-Prepopulating-fields-to-your-JotForm-via-URL-parameters

    1) determine what the URL should be. For my form's example it just has a parent name, child name, and a check box whether they'd like to add another child. In order to prepopulate the field we need to use a variable to set the URL correctly each time. Here's the final URL for my example:

    http://form.jotformpro.com/form/50769595618977?parentName={parentName}

    Notice the last part, ?parentName={parentName}

    This has two parts to it that we need to find. First, the left side, second the right side. In this case they both happen to be exactly the same.

    a) to determine what are all the left side parameters, use the field populator app you referenced above. http://apps.jotform.com/app/field_prepopulator

    Navigate there, and enter fake data for every field you want to be able to pass to the next form.

    This will give you a URL ending with something like ?parentName=JohnTheParentFakeName&phone=111FakePhone...

    The part we care about here is the left side of the equal sign. Once we have all these, then we need to find out what the right side should look like. They may end up similar to the left side, in curly braces. To determine for sure, we need to go back to the form builder and inspect each one.

    How to pre fill a form with the previous forms responses Image 1 Screenshot 30

    Then you need take those values, and replace the right side of the parameters with it. That way every time someone submits the form it will use the latest value. By now the URL should end with:

    ?parentName={parentName}&phone={phone}...

    Please note that determining the address fields takes extra care, since they're all part of a single field and need to be represented differently. Here's a doc on that:

    http://www.jotform.me/help/92-How-to-Strip-Headers-from-Postal-Addresses-in-Email-Alerts

    The end result will look something like {address:streetline1}, for each field within the address.

    2) The last part is easy. You want to set up a conditional redirect to the new URL, if the user selects the option to add another child.

    a) first add a check box if the user wants to add another child

    b) set up a condition to redirect to a custom URL if the check box is filled. Here's what mine looked like:

    How to pre fill a form with the previous forms responses Image 2 Screenshot 41

    If everything's set up correctly, when the check box is selected, the user will be directed to a new version of the form with the selected fields prepopulated.

    Please give this a try, if you can follow it. If you need assistance, let us know.