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.

Create a Button to calla flow in Salesforce Lightning

5. Then, we need to add this Button to the Page Layout to display the user. For that, click on the Page Layout and click on the Drop-Down arrow to edit this page layout. You can add this button to any layout you work with. Here, I’m adding the Account Layout.

Call a Flow From Button in Salesforce Lightning

6. As we click on the edit button, you will see the following layout. To add a button on the Lightning Component, we have to select the Mobile & Lightning Actions. In that, you can see we have a Call a Flow button that we created in the above steps.

Drag and Drop that button in the Salesforce Mobile and Lightning Experience section, and then Save the changes.

How to create a button to call a flow in Salesforce

7. Now, go to the object on which you have created a button and then click on any record because these buttons get added to the Record Page. Here, I have created a button on the Account object.

As I clicked on the Account Tab and then opened any record, you can see the Call a Flow button on the screen.

How to Call a Flow From Button in Salesforce

8. As we click on the call a flow button, the Fields and Buttons will display on the screen that we have added in the Screen Flow.

How to Call a Flow From Button in Salesforce Lightning

This is how we can create a button to call a flow in Salesforce.

Conclusion

I hope you have an idea about calling a flow from a button. In that we have seen what a button is in Salesforce and when we can use it to call a flow, and we have also seen how to create a button to call a flow in Salesforce with scenario and explanation.

You may like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.