Prefill Through the URL 


In this Article
Related Articles

Overview

You can build a link to prefill any web form. Before you begin, consider the size and content of the link. The more fields you choose to prefill, the longer the link gets, and longer links can easily break. So keep in mind: The shorter the link, the better.

It's also easiest to prefill fields which don't have spaces. Spaces can also cause links to break.

In most cases, however, it's possible to work around these concerns.
 

Note: If you're sending your prefill link by email, you can use a mail merge process to populate the merge fields and to send out the email. It's optional, but more efficient.

Video Tutorial

Learn how to prefill your forms. We go over what types of links, passing from one form to another, passing multiple fields and more.



Prepare to Build Your Link

To build your prefill link, you'll need:

The form's address (URL)

    • Go to the Publish page and copy the public address under Your form is publicly available at this address.

      If you've published the form on your own website page, you can also use that page's URL. Now, decide which fields you want to prefill.

The aliases of the fields you want to fill

    • In the Publish page for your FormAssembly form, you'll find a link at the bottom of the page: Show how to prefill form data dynamically.

      Click this link to find the field alias(es) you'd like to prefill.


Here are the prefill parameters for the form we'll be looking at:

prefill_aliases


Build Your Prefill URL

You can use a basic text editor to build your link, like Notepad or TextEdit. Here's a form link from the Publish page, where 237760 is the form ID.
http://www.tfaforms.com/237760

Now, copy your form URL from the Publish page, and place a question mark after it. Here's what our example link looks like:
http://www.tfaforms.com/237760?

Next, pick one field alias from the list that you want to prefill, and place it after the question mark. Here, we're using the email field "tfa_16." Add an equals sign after the field alias.
http://www.tfaforms.com/237760?tfa_16=

After the equals sign, you'll want to enter the data that will prefill the form field.
http://www.tfaforms.com/237760?tfa_16=name@domain.com

Or you can use a merge field from an email system.
Salesforce
http://www.tfaforms.com/237760?tfa_16={!Contact.email}
MailChimp
http://www.tfaforms.com/237760?tfa_16=*|MERGE0|*

Prefilling a Multiple-Choice Field

List, Radio Button, or Drop-Down Menu


When prefilling a selection list, radio button, or drop-down menu field, the question has an alias, and so the does the choice.

You'll be placing the alias of the question before the equals sign and the choice alias(es) after the equals sign.

prefill_toppings

You can use the choice's field alias as the value.
tfa_11=tfa_12

Or you can use the exact text of the choice.
tfa_11=Lettuce

In this example, the question is a menu list, where you can select multiple answers by separating them with a semicolon.
tfa_11=Lettuce;Onion
 

Checkbox

 
Note: It's now possible to check or uncheck a checkbox through the URL.  You can use a "0" to uncheck a checkbox or a "1" to check a checkbox.


Checkboxes work a little differently than other multiple-choice fields.

The alias before the equals sign is the choice alias. The question has no alias.

prefill_checkbox

When you're using checkboxes, you can use a 1 (which means "TRUE") to check a box or 0 (which means "FALSE") to uncheck a box.
tfa_19=1 or tfa_19=0

Or, you can use the exact text to fill the field.
tfa_19=Yes

Prefill More than One Field

To prefill more than one field, you can add more field aliases with their value, separated by an ampersand (&).
http://www.tfaforms.com/237760?tfa_17=name@domain.com&tfa_17=MyFirstName&tfa_21=MyLastName
Repeat this as needed, but remember that the shorter the link, the better.

Pass Data Between Forms

If you're passing data between FormAssembly forms, you'll want to place the first form's value aliases nested inside double percent (%%) signs.
http://www.tfaforms.com/xxxxxx?tfa_email2=%%tfa_email1%%
In the example above, tfa_email1's value from the first form will be passed to the field tfa_email2 on the second form.

Once you are finished building the URL, place the URL in the redirect field in the Notifications page of your first form.
 

The "POST" Method


You can also use the "POST" method to prefill your forms. Users with advanced technical expertise can pre-populate a web form dynamically by "posting" data to the web form itself. This method is most helpful when passing data that does not pass well through the URL, like multi-line text fields.

Here's a short example. This first form prefills the "subject" field in a second form, FormAssembly's Contact Form:
 

Here's the corresponding HTML:
<form action="http://app.formassembly.com/forms/view/2" method="POST" >
<input type="text" name="wf_Subject" value="subject goes here"/>
<input type="submit" value="Open the Contact Form" />
</form>
The form will accept a HTTP POST request and match submitted name/value pairs with its own field names. Unknown fields are ignored. Matching fields will take the submitted value.

To find the field name used in your form, inspect the HTML source, or:
  1. Go to the Form List and click configure on the form you need to set up. This opens the form properties panel on the left-hand side.
  2. On the Publish page, click the Show how to prefill form data dynamically link.
Note: This works only for forms hosted on FormAssembly or published using our API. The Copy & Paste publishing method does not support form prefilling using a HTTP POST request.
Terms of Service · Privacy Policy