Add a Flow to a Lightning Page

Add a Flow to a Lightning Page

Last Updated on February 10, 2022 by Rakesh Gupta

Big Idea or Enduring Question:

How do you add a Flow to the Lightning Record Page?

Flow can be run through custom action, Custom button, the flow URL, a Lightning page, a Visualforce page, etc. In this article Add Record to Multiple Chatter Groups – Parsing Multi-Select Picklist fields (Flow) I have promised to discuss the way to execute a flow from the lightning record page. 

In the past, I have written a few articles related to the Chatter Group and Record. Why not check them out while you are at it?! 

  1. Getting Started with Salesforce Flow – Part 26 (Automatically Add a Record to Chatter Group)
  2. Getting Started with Process Builder – Part 42 (Auto remove a record from Chatter Groups)

In this blog post let’s discuss how to add a flow in the lightning page to distribute to Lightning Experience or Salesforce app Users.


This blog post will help us to understand the following

  • Add a flow to the lightning record page 
  • define the filter condition to show the flow to specific users 

Business Use Case

Brenda David is working as a System administrator at Gurukul on Cloud (GoC). She has created a flow that allows their sales users to add an opportunity to multiple Chatter Groups. She has the following requirements: 

  • Make the flow accessible from the Opportunity lightning record page
  • Flow is only available for users who have the Standard User profile

Automation Champion Approach (I-do):

Any active screen flow can be added to a lightning page. In the scenario, we will add a ScreenFlow which we created in this article to an opportunity lightning record page. 

Things to Remember:

  1. Only active screen flows are available to be added to the lightning record page.
  2. By default, flows display in one column.
  3. Flow’s input variables appear only if they allow input access.
  4. Pass record ID into this variable – This option is available only for Text input variables in Record pages. For simplicity, I recommend passing the ID to only one variable.

Before discussing the solution, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes to go through the following Flow diagram and understand it.

Let’s begin building this automation process.

Guided Practice (We-do):

There are 2 steps to solve Brenda’s business requirement using Screen Flow and Flow Component. We must:

  1. Create a Screen Flow 
  2. Add flow to the opportunity lightning record page and add filter criteria 

Step 1: Create a Flow 

Please go through this article first and make sure to complete the listed steps: Add Record to Multiple Chatter Groups – Parsing Multi-Select Picklist fields (Flow)

Step 2: Add a Flow to Opportunity Lightning Record Page and Add Filter Criteria 

The next step is to distribute a flow to Lightning Experience or Salesforce app users, by embedding it in the Opportunity Lightning record page.

  1. Click Setup.
  2. In the Object Manager, type Opportunity.
  3. Select Lightning Record Pages, click on the Label to open the page.
  4. Click on the Edit button to open a Lightning page in the Lightning App Builder.
  5. From the Lightning Components pane on the left, drag the Flow component onto the Lightning page canvas.
  6. Input the following information:
    1. Select Add Record to multiple Chatter Groups flow
    2. For VarTOpportunityID
      1. Select Pass record ID into this variable checkbox

    3. Click + Add Filter
    4. Set Filter Conditions
    5. Row 1:
      1. Field: User > Profile > Name
      2. Operator: Equal
      3. Value: Standard User
  7. Click Done.

Once everything looks good, click the Save button. 

Proof of Concept

Now onwards, Sales users (with profile Standard User) can this tool and add an opportunity record to multiple Chatter Groups

Formative Assessment:

I want to hear from you!  

What did you learn from this post, is it relevant to you, and how will you modify the concepts taught in the post for your own business processes? 

Make a post and tag me on Twitter @automationchampusing #AutomationChampion. 

Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

2 thoughts on “Add a Flow to a Lightning Page

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.