Dynamic record link using Salesforce Flow

How to create a Record Link in Salesforce Flow

Salesforce Flow is a automation tool in Salesforce that lets you automate business tasks.  One useful feature of Flow is the ability to create record link in Salesforce.

These links let you quickly go to specific records in your Salesforce org. In this blog post, we’ll go through the steps of creating a dynamic record link in Salesforce Flow.

Want to Learn Salesforce Flows? Learn with our Salesforce Flow Course

Before creating a dynamic record link, it is essential to understand the relationships between the object and fields you are using in the Flow.

Make sure you have the required access permissions to work with the objects and fields involved in the dynamic record link creation process.

To generate dynamic record link in Salesforce, we will be creating a Screen Flow.

We will take First Name and Last Name as an input from the user and create a Contact record.

Using the record Id of the created Contact record, we will generate a dynamic record link.

Now, you can directly navigate to Flow Builder by clicking on the “Create” dropdown button on the home page of your Salesforce org.

Dynamic record link in Salesforce

In the Flow Builder Canvas, drag the Screen component, enabling the user to provide relevant information for the creation of the record.

Record link in Salesforce Flow

By utilizing the options in the screen properties section, specifically the “configure header” and “configure footer” drop-down menus, one can customize the header and footer sections of the screen element.

To create the record, drag the CREATE RECORD element onto the canvas.

After dragging the CREATE RECORD element from the toolbox, we should provide details such as Label, API Name (automatically populated), Description, and object name.

Once we have chosen the object for record creation, it is necessary to map the user-provided data with the corresponding object fields.

Contact Record Creation

NOTE: Whenever you want to store the record Id of the newly created record, always check the Manually assign variables checkbox as TRUE.

We will create a text variable contactId to store the record Id of the newly created Contact record.

Variable to store Contact Id

Add a Screen element to display the dynamically created record link to the user.

To generate the dynamic record link, a formula is created within the Screen component.

Record Link Generation Formula

Let’s understand the elements used in generating the above mentioned formula:

1. {!$Api.Enterprise_Server_URL_510}

It is a global variable in Salesforce providing the base URL that can be used to create URLs for different Salesforce resources and APIs.

Salesforce users commonly leverage this global variable in formula fields, email templates, or custom code to dynamically create URLs.

2. ContactId

It is used to store the newly created Contact object record’s Id.

3. FIND(‘/services’,{!$Api.Enterprise_Server_URL_510})

The FIND function searches for the position of the “/services” substring within the {!$Api.Enterprise_Server_URL_510} global variable. If the substring is not found, it returns zero.

Now, save the Flow and Debug it.

Provide the First Name and Last Name of the Contact and click Next.

A new Contact object record will be created and the record link will be displayed.

Final Output of Record Link Creation

As you can see in the above image the record link generated is not clickable.

To make the URL clickable, navigate to the record link generation variable and Select Link Button.

Record Link Clickable

Paste the variable name in Link URL field and save the Flow.

Now you can see the link generated for the newly created Contact record is clickable.

Record Link Final Output

Business Use cases to implement dynamic record link creation:

  • Project managers require a means to share project records to team members and stakeholders to facilitate updates and collaborative efforts.
  • We must optimize the employee onboarding process and ensure the comprehensive delivery of essential information to new hires.

For more details, check out the video below !!

Get a complete Roadmap To Learn Salesforce Admin And Development 👇

Share Now

Harshit is a 5x certified Salesforce developer currently working at UST. He is a storyteller at heart, with a knack for crafting compelling content on LinkedIn and penning insightful blogs on Salesforce technology.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *