How to Populate a Form with Salesforce Data


You can populate a form using custom links or buttons created in Salesforce. These links can be added to the Salesforce interface and also included in emails sent from your Salesforce account.  Before beginning, be sure that you have created the necessary fields that you wish to prefill on your form.  You can see which fields exist on your form, and their prefill names, by going to our prefill documenation page.

Using a Prefilled Link in a Mail Template

  1. Login to your Salesforce application and click “setup” (in the top right corner).
  2. In the left-hand bar, find “Admin Setup”, click “Communication Templates” then Email Template”.
    (Note that you can also create templates by going to “Personal Setup”->“Email”->“My Templates”)
  3. Click “New Template” then select the type of template you wish to create.
  4. Provide your template with a unique name, such as ‘Contact Happiness Survey’.
  5. Create the body of your email template.
  6. At the point where you wish to create your prefilled FormAssembly form link, type:

    <a href=“”>Please click here to take our survey.</a>

  7. Paste the link to your form into the href attribute, resulting in:

    <a href=“http://www.tfaforms.com/90″>Please click here to take our survey.</a>

  8. Add to the link the pre-fill parameters, for instance:

    <a href=”http://www.tfaforms.com/90?tfa_Company={!Lead.Company}&tfa_LeadId={!Lead.Id}”>Please click here to take our survey.</a>

    Refer to the documentation to find the exact syntax for each field.

    salesforcemail

  9. Save the template.
  10. Use this template when sending your campaign to your users.

Salesforce will automatically populate each email with the appropriate data, for example:

<a href=”http://www.tfaforms.com/90?tfa_Company=Smith Co&tfa_LeadId=a0370000006d7yAAAQ“>Please click here to take our survey.</a>

Click here for more on emailing pre-filled web forms.

  1. Login to your Salesforce application and click “setup” (in the top right corner).
  2. In the left-hand bar, click “App Setup”, then “Customize”
  3. Click “Buttons and Links” and add a new “Custom Buttons and Links”.
  4. Enter a label such as ‘edit with FormAssembly.com’
  5. Paste the link to your form, for instance:

    http://www.tfaforms.com/90

  6. Add to the link the pre-fill parameters, for instance:

    http://www.tfaforms.com/90?tfa_Company={!Lead.Company}&tfa_LeadId={!Lead.Id}

    Refer to the documentation to find the exact syntax for each field.

    #

  7. Save the new link.
  8. Add the link to a page layout (refer to the Salesforce documentation if you need help with this).

That’s it. When clicking on the link from your Salesforce account, the form should open up in a new window with the data pre-populated.