Form Pre-population with Salesforce Data in 3B Forms v4+

From 3B Knowledge
Jump to navigation Jump to search

3B Forms v4 introduces a powerful feature that enhances user experiences by allowing forms to be pre-populated with Salesforce data. This capability streamlines data entry and ensures accuracy when collecting information through forms. In this article, we'll delve into how to leverage this functionality to its fullest potential.

Understanding the "recordId" Parameter

To enable pre-population of 3B Forms with Salesforce data, you'll need to provide a new URL parameter called "recordId." This parameter serves as the key to unlocking the pre-population feature. Here's a breakdown of how it works:

  • URL Format: The URL for your form should look something like this:
    • id: This parameter specifies the form's ID.
    • recordId: The "recordId" parameter contains the Salesforce object record ID you want to use for pre-population.
    • versionId (Optional): If needed, you can include the "versionId" parameter to load a specific form version.

Pre-populating Forms in a Web Component

If you've embedded a 3B Form as part of a web component, you can achieve pre-population by including specific attributes within the component's HTML code. Here's an example:

<form-complete
    form-id="xxxxxx"
    version-id="xxxxxx"
    record-id="xxxxxx"
></form-complete>
  • form-id: Set this attribute to the ID of the form you want to use.
  • version-id (Optional): Similar to the URL parameter, you can specify a specific form version with this attribute.
  • record-id: This attribute is crucial. It defines the Salesforce object record ID for pre-population. If you omit it, the form will load in "insert mode," presenting a blank form.

Matching the "recordId" to the Core Object

To ensure seamless pre-population, it's important to note that the "recordId" should correspond to the core object set on the 3B Form. The core object is the contextual object for the form and determines which Salesforce record the form will interact with.

Targeting Specific Fields with URL Parameters

You can now use URL parameters to pre-populate specific fields within your forms. For example, if you're working with a form designed for the Contact object, your URL might look like this:

b3f__Form?id=xxxxx&recordId=xxxxx&AccountId=XXXXX&FirstName=James&....

Here's how it works:

  • id: Identifies the form you're working with.
  • recordId: Specifies the Salesforce object record ID for general pre-population.
  • Field Parameters: Any field name provided in the URL parameters will override the pre-population by "recordId."

Combining URL and RecordId Pre-population

The flexibility of 3B Forms v4 allows you to use URL pre-population in combination with "recordId" pre-population. This means you can pre-populate some fields through the URL while using the "recordId" for others. This flexibility ensures that you have full control over how each field is populated, tailoring the form to your specific needs.

Pre-population Order of Priority

When multiple pre-population methods are in play, 3B Forms v4 follows a specific order of priority to determine which value should be pre-set on the rendered form:

  1. URL Parameters: If a field is specified in the URL parameters, this value takes precedence and is used to pre-populate the field on the form.
  2. "recordId" Pre-population: If a field is not specified in the URL parameters but is available on the pre-populated Salesforce record (via "recordId"), it will be used to pre-populate the field on the form.
  3. Default Field Value: If no value is found in the URL parameters or through "recordId" pre-population, the field's default value, as set in the form builder, will be used. This ensures that even if no specific pre-population data is provided, you still have a default value in place.

Leveraging Salesforce Default Values

It's important to note that even if no default value, URL parameter, or "recordId" pre-population is available, 3B Forms v4 can still leverage Salesforce's default value for a field. When a form is saved, Salesforce's default value for the field definition will be assigned, providing a fail-safe mechanism to ensure data completeness.

With this advanced form pre-population feature, 3B Forms v4 offers unparalleled flexibility and control, enabling you to create tailored and efficient data entry experiences. Whether you need to populate fields via URL parameters, "recordId," or default values, you have the tools to optimize your forms for your unique needs.


By following these guidelines and providing the appropriate "recordId" parameter, you can unlock the full potential of pre-populating 3B Forms v4 with Salesforce data. This feature not only simplifies data entry but also enhances the accuracy and efficiency of your form-based interactions.

If you have further questions or need assistance with implementing this feature, please reach out to our support team for expert guidance and support. Enjoy the benefits of seamless data pre-population in 3B Forms v4!