How to Call a Flow From Button in Salesforce | How to Launch Flow From Button in Salesforce

In Salesforce, when we want to open any flow, we need to follow lengthy steps to invoke it, but we have the option to use the button to open a flow with a single click.

In this Salesforce article, we are going to learn how to call a Flow from Button in Salesforce. We will also learn what a button is in Salesforce and when we can use it to call a flow, and we will see how to create a button to call a flow in Salesforce with a scenario and explanation.

Call a Flow From Button in Salesforce

What is the button in Salesforce?

In Salesforce, Buttons, Actions, and Links are the standard functionality that lets users interact with Salesforce data and external services. We can also create custom buttons and do tasks such as creating records and jumping to the next window using custom button links.

When can we use a button to call a flow in Salesforce?

Following are the uses of buttons to call a flow:

  • When we have a screen flow that we don’t need to apply on Org UI, we create a button, and we can see the screen flow fields using it.
  • When we want to open any flow, we need to follow lengthy steps to invoke it, but we have the option to use the button to open a flow with a single click.

Scenario:

For example, we have created a screen flow, and we don’t want to add it to the Salesforce UI, but whenever we want to open that screen flow, we have to click on the button, and we can use it. That’s why we need a button and add it to the page layout.

How to Create a Button to Call a Flow in Salesforce

Using the above scenario and the following steps, we can create a button to call a flow in Salesforce.

1. First, we need a screen flow or any flow you want to add on the button so that whenever a button click event occurs, it invokes that particular flow. Here, I have created Create an Account using Screen Flow.

You can read the whole article on Flows and its Type in Salesforce.

2. Now, we need to create a button to call Screen Flow that we have created.

As you log in to Salesforce.org, on the Home Page, you will see the Object Manager tab. Click on it, and in the search option, search for the object that you want to create a Button to call a flow. Here, I have selected the Standard Account object. Click on that object.

Call a Flow From Button in Salesforce

3. As we click on the Account object, we can see there is an option Button, Links, and Action on the left side of the screen. Now we will click on New Action to add a flow on the Button.

Create a Button to calla flow in Salesforce

4. Now, we will create an Action to add a button. For that, enter the following details:

  • Object Name: It will display on which object we are creating the button.
  • Action Type: Here, we want to create an action on the flow, so we have to select the Flow option in this field using the drop-down arrow.
  • Flow: In this field, we can select which flow we want to call when the button click event happens. Only activated flows are allowed here. Activate each flow we want to add first. Here, I have selected Create an Account Screen Flow.
  • Label: We can customize the labels as per our requirement; here, I have entered Call a Flow. This Label will display on the button on the screen.
  • Name: This is an API name that will populate automatically.
  • Change Icon: We can change the icon of the button.

Then click on the Save button.