Skip to main content

Return to TX Community

Liaison

Passing FormAssembly Field Values via the URL

Passing FormAssembly Field Values via the URL

It is possible to pass through values in the URL for both inquiry forms and events forms (new in Events 5.0), which allows you to prefill form fields with specified data values. 

Notes: 

  • Prefilled values can only be mapped to Objects specified in the Salesforce Connector on the FormAssembly form. 
  • The School Picker field cannot be prefilled.  

Identifying FormAssembly Field Names to Prefill

To prefill using URL parameters; you must first obtain the FormAssembly field name for the questions you are prefilling. The entire field name will begin with "tfa_" and include the field number, for example, tfa_12. To find the field name:

  • In the CRM, select FormAssembly from the app picker in the top right corner
  • Click Manage Forms
  • Select the form you would like to prefill and click the "Publish" tab
  • Click "Show how to prefill form data dynamically" from the bottom of the Publish tab
  • A chart should appear showing the form questions and their assigned field name
  • Make a note of the tfa_## values for each question you'd like to prefill

Building the Form URL

Once field names have been identified, they can be added to the Inquiry Form or Events Form URLs with the corresponding values to prefill. 

Example

Your Event Site URL is myschool.force.com/events, and the field name for the "Source" field is tfa_23. You would like to populate one source value in the form when accessed online (Source=WebEventReg) and another when accessed via email (Source=EmailEventReg).

Prefilled event URL online: myschool.force.com/events#/?tfa_23=WebEventReg

Prefilled event URL emailed: 
myschool.force.com/events#/?tfa_23=EmailEventReg

Notes: 

  • To prefill more than one value, add an "&" between the field names.
  • If you are already passing through the Event ID or other IDs, you can add an "&" after the ID value and enter your FormAssembly field names to prefill. 
  • Please keep in mind that if you pass through the Contact ID in Events URLs, it will bypass the registration form entirely. 
  • Best Practice recommends not passing through Personally Identifiable Information as URL parameters.

How to Prefill Event Registration forms using the Salesforce Prefill Connector

  1. Setup FormAssembly form to use Prefill. The form should already be set up as needed How To Set Redirect for Event Registration In Form Assembly.  

Notes:

  • The Salesforce prefill connector should have an unsafe parameter using a value of any choice, except it should never be cid. Including cid in the URL will bypass the form altogether.
  • Map all Salesforce fields you would like prefill on the form.

 

  1. Use the following format for the prefilled URL:


Event-Specific Registration Links:
<<SiteURL>>#/calendar?eid=<<Event ID merge field>>&<<Prefill Data for FormAssembly Form>>

General Event Search:
<<SiteURL>>#/list?tfa_37=FirstName&tfa_38=LastName&tfa_23=Email
<<SiteURL>>#/calendar?tfa_37=FirstName&tfa_38=LastName&tfa_23=Email

 

Email Template

Event-Specific Registration Link:

https://myschool.secure.force.com/training/events#/esr?eid={!TargetX_Eventsb__OrgEvent__c.Id}&contactid={!Contact.Id}&k={!Contact.TargetX_Base__Access_Key__c}

General Event Search

https://myschool.secure.force.com/training/events#/?contactid={!Contact.Id}&k={!Contact.TargetX_Base__Access_Key__c}

Resulting URL

https://myschool.secure.force.com/training/events#/esr?eid=a0UF000000fARh3&contactid=003F000001WpOsRIAV&Contact.TargetX_Base__Access_Key__c=257D

https://myschool.secure.force.com/training/events#/?contactid=003F000001WpOsRIAV?Contact.TargetX_Base__Access_Key__c=257D

Note:  Notice this uses contactid as the prefill parameter and not cid. This will ensure you still get presented with a form prefilled with contact data. This also means that if you want to prefill data from the Organization Event object, you will have to use an additional parameter that is not "eid."  Use something like "eventid" and set it up this way in the prefill connector of the form.  

https://myschool.secure.force.com/training/events#/esr?eid=a0UF000000aqqme&contactid=003F000002BbuUd&Contact.TargetX_Base__Access_Key__c=257D
&eventid=a0UF000000aqqme

  • Was this article helpful?