Salesforce Prefill Connector 

In this Article
Related Articles


The Salesforce Prefill Connector allows you to retrieve data from your Salesforce org and display a prefilled form to your respondents. Learn more about why it's handy. 

Provided you have set up a prefilling link and a query parameter in your Salesforce Prefill Connector, you will be able to pull information from Salesforce records directly into your form.  More information on this setup can be found in the videos below.


You'll need FormAssembly's Premier or Enterprise Plan.  You will also need to create a prefilling link and setup a query parameter in your connector.  Please watch the videos below for more information on these two steps.

Note: The prefill connector will not run if you have not setup both a prefilling link and a query parameter in your connector.  A standard link to your form that does not contain a query parameter cannot be used for prefilling.  

Additionally, this connector doesn't work with forms published using the copy & paste method.

Recommended Publishing Methods
  • WordPress
  • Salesforce Portal/Communities
  • Hosted by FormAssembly

Watch the Videos

Salesforce Prefill Connector Setup

This demonstration of the Prefill Connector shows:

  • Configuring the Salesforce Prefill Connector
  • Prefilling an Account record and a dependent Contact record into the form.

The Salesforce Prefill Connector Part 2 36:58

This demonstration of the Prefill Connector shows:

  • Prefilling different field types.
  • Prefilling conditional triggers & hidden conditional triggers.
  • Prefilling repeated fields and sections.

Prefill & Update Loop with Salesforce (Premier & Enterprise) 46:54

See the full loop of prefilling a form with Salesforce data using the Salesforce Prefill Connector, then updating multiple records in Salesforce.

This video shows:

  • A short of updating and prefilling.
  • Building a prefill update loop.

Configure the Connector

Step 1. Credentials

For additional information on these steps, and a video walkthrough, please see the videos above.

To begin, first choose a Salesforce profile which has API access and read access to the Salesforce objects you intend to retrieve.

Enter the Salesforce username, password, and security token for the profile which you will use to query your Salesforce org (i.e., search for matching data).

Step 2. Lookup Query

First decide:

  1. Which record do you want to prefill with?
  2. Which Salesforce field will you use to uniquely identify each record?
Click the Configure your First Lookup button to get started.

  1. In the select an object drop-down menu, choose your object to lookup.
  2. Click Ok.
  3. In the area labeled Lookup #1, choose the Salesforce field which you will query.
  4. Select the operator in the middle drop-down, i.e., Equals.
  5. Select an unsafe query parameter. A parameter uniquely defines your query.
  6. Enter a value to represent the parameter. This is very flexible, and it's up to you. In this case, the value is acctid, short for account ID.
    Note: This is case sensitive and you should not use any special characters (i.e. &,_,@) or spaces.  In general, it is best to keep this query parameter simple and text-based.
  7. Add additional parameters, if needed.

Decide when to prefill.

Under each lookup, confirm what to do if/when records are found.

Step 3. Field Mapping

Next, map the fields you would like to prefill in the form. Select a field from your form on the left, select the matching field in Salesforce on the right, and click Ok.

Click Map Another Field for each field in your form that you want to prefill.  

Please note, that while formulas can be used in field mapping, field aliases cannot be used in the Prefill connector as they have no value prior to the form being completed. 

Any time you add a new field to your form it will need to be mapped in your connector, even if it has the same name as a previously deleted field.

When prefilling checkboxes from Salesforce the connector will automatically detect which Salesforce fields are checkboxes and give you the option of selecting "checked" or "unchecked" for your mappings in the connector.  When mapping fields, or prefilling through the URL, you can also use "0" to uncheck a checkbox or "1" to check a checkbox.

When dealing with upload or attachment fields, it is not possible to prefill files of any kind.  It is possible to prefill a file name from an attachment into a text field, provided the attachment was created through a FormAssembly connector.

Step 4. Working with Multiple Records

If you need to retrieve more than one record to prefill your form, click Add another lookup or Add an Object dependent on... to set up another query and field mapping set.

On subsequent steps of the connector, you'll find an additional lookup option (a lookup result) to reference a previous lookup.

Direct Your Respondents to a Prefilled Form

  • Send a Prefilled Link
    • Send a custom link in an email containing an identifying value.
  • Use Two Forms
    • The respondent enters an identifying value into Form 1. After clicking submit, the respondent is directed to a prefilled Form 2.
Note: You must build a prefilling link for either option. Watch the video.  If you send a standard form link (e.g. you will not be able to trigger the prefill connector to run.  Prefill links have a specific format and must be aligned with your query parameter.

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, you can also use that URL.
The parameter name you want to fill
    • This is the name you gave the parameter in the connector. In this example, it would be acctnum.

Build Your Link

Please make sure to follow all the steps listed below when building your prefilling link.  A standard form link will not be able to trigger the prefill connector to run.

You can use a basic text editor to build your link, like Notepad or TextEdit. Here's a form link from the Publish tab, where 283230 is the form ID and "xxxxx" is the enterprise instance ID.  

If you are not an enterprise user, then your URL will look like

Now, copy your form URL from the Publish page, and place a question mark after it.

Here's what our example link looks like:

Next, use the query parameter that you set up in your connector and add that after the question mark. Here, we're using a query parameter that represents the Account Number, acctnum.

Add an equals sign after the parameter name.

After the equals sign, you'll want to enter the data that will prefill the form field.  If you are using a Salesforce Email template to send out your link, this value would be a merge label, for example: {!Contact.Id}

Learn more about building a link to prefill forms.

Send a Prefilling Link

After you've built the link, you can place it in an email as is, or you can make it dynamic by using a merge field from an email system.

Here's an example for Salesforce merge fields:{!Account.AcctID}

Here's an example for MailChimp merge fields:|MERGE5|

Use Two Forms

In this setup, the respondent would initiate the prefilling of Form 2 by submitting Form 1 after entering their uniquely identifying value into the form field.

In the Notifications tab of Form 1, the redirect field would need a URL similar to:

The field alias %%tfa_1%% will be filled by the value entered into the field on Form 1.

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 with.

Additional Methods to Query the Salesforce Database

Session Parameters

Session parameters are only available if Salesforce community authentication is enabled for your form.

To use a session parameter, select Formula in the value [2] drop-down menu, and enter one of the following aliases (including the %% signs):

Salesforce Portal Aliases:
%%SF_PORTAL_USER_ORGID%%The Organization ID of the portal user
%%SF_PORTAL_USER_USERID%%The User ID of the portal user
%%SF_PORTAL_USER_PROFILEID%%The Profile ID of the portal user
%%SF_PORTAL_USER_ROLEID%%The Role ID of the portal user
%%SF_PORTAL_USER_USERNAME%%The username of the portal user
%%SF_PORTAL_USER_EMAIL%%The email of the portal user
%%SF_PORTAL_USER_FULLNAME%%The full name of the portal user
%%SF_PORTAL_USER_LOCALE%%The locale configured for the portal user
%%SF_PORTAL_USER_TIMEZONE%%The time-zone configured for the portal user

See the Salesforce Developer documentation for a more complete description of each value.

Secure Parameters

You can visit our Prefill Lookups Using Secure Parameters page in our knowledge base to learn more about how to implement this functionality.

Prefill Request Limit for Repeated Fields and/or Sections

It is important to note that the Salesforce Prefill Connector will stop at 250 records per object. Please keep this limit in mind if you are prefilling repeatable fields or sections that may return more than 250 records per object.

Prefilling Conditional Triggers

At times it may be useful to prefill a checkbox field in order to use it as a conditional trigger.

You can use a setup like this to have your form take on different looks depending on if a record exists or don't exist on the Salesforce side.

In other words, you can say, "if a contact exists, then check this box in my form."  To accomplish this, you can setup your connector like the image below:

In the example above, if no matching record is found, prefilling will be skipped. However, if a record is found, then the checkbox will be checked because you have a value of 1 mapped to both the formula and the send-as value. Please note, that you need to map a value of "1" in both of those locations for a setup like this to work.

From there, you can use the checkbox field in your form as a conditional trigger. Any time a contact record is found, the box will be checked, and any time a contact record is not found, the box will remain unchecked.

Salesforce API Version

When you initially create your connector and authenticate your Salesforce instance, that connector will be setup based on your current version of the Salesforce API.

The connector will not be upgraded when a new Salesforce API version is released, regardless of the checkbox status at the bottom of the connector:

Once FormAssembly supports a new API version, the box will be automatically checked and the API setting will show the previous API version. Since API changes are not always backward compatible, this ensures that a connector will continue to work after an API update.

Terms of Service · Privacy Policy