Building and Distributing 3B Forms: Generating Secure Links and Dynamic Record IDs

3B Forms v4 offers a streamlined process for form distribution, and rather than a traditional "Publish" button, it provides a more secure and dynamic way to share your forms. In this article, we'll delve into the process of generating secure links and dynamically populating the recordId parameter for testing, previewing, and distributing your forms.

Generating Secure Links

Instead of a "Publish" button, 3B Forms generates secure links that can be used for various purposes, such as testing, previewing, and distributing forms. These links ensure data privacy and security. You have two options when generating links:

1. Non-Secure Link

The non-secure link passes all URL parameters openly. This type of link is suitable for internal testing and previewing. It typically looks like this:

b3f__Forms?id=xxxx&recordId=xxxx&...

2. Secure Link

The secure link is designed to enhance security by passing a single encrypted parameter called "key." This approach minimizes the risk of exposing different IDs in the URL. Secure links are ideal for distributing forms to external users while safeguarding sensitive data. A secure link might look like this:

b3f__Forms?key=encrypted_key_here

Dynamically Populating the recordId Parameter

To make your forms as versatile as possible, it's important to dynamically populate the recordId parameter. This ensures that the form can adapt to different contexts and use cases. Here are several methods to dynamically populate the recordId parameter:

1. Record Quick Action

You can use a Record Quick Action to merge the id and recordId parameters with the context record where the quick action is displayed. For example:

b3f__Forms?id={!Record.Id}&recordId={!Record.Id}

This approach ensures that the recordId parameter is always associated with the relevant record.

2. Community App Builder

When using the Digital Experience builder in Salesforce Communities, you can set the parameters dynamically. For instance, you might configure the URL like this:

b3f__Forms?id={!$CurrentPage.parameters.formId}&recordId={!$CurrentPage.parameters.recordId}

This allows you to pull the formId and recordId parameters directly from the page context.

3. Embedded on a Record Detail Page

If you embed a form on a record detail page, you can use the record's ID as the recordId parameter:

b3f__Forms?id=xxxx&recordId={!Record.Id}

This method ensures that the form is associated with the specific record on the detail page.

4. Email Template/Send Email Flow Action

When sending emails with embedded forms, you can populate the recordId parameter dynamically within an email template or a Send Email Flow action. For example:

b3f__Forms?id=xxxx&recordId={!Related_Record__c.Id}

This approach is useful when you need to send forms as part of automated email communications.

5. Formula Field

You can create a formula field that concatenates the form URL with the recordId parameter dynamically. This formula field can then be displayed on a record detail page or used in a custom action.

6. Custom Action

Custom actions in Salesforce allow you to define your own logic for populating parameters. You can create a custom action that generates the form URL with the appropriate recordId parameter based on your specific requirements.

These methods provide flexibility and adaptability when it comes to populating the recordId parameter dynamically. Choose the approach that best fits your use case and workflow, ensuring that your forms seamlessly integrate with your processes.

By generating secure links and dynamically populating the recordId parameter, 3B Forms v4 empowers you to distribute forms effectively while maintaining data security and context-awareness.