Loading
Salesforce now sends email only from verified domains. Read More
Automate Your Business Processes
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Run a Flow from a Custom Record Page Button

          Run a Flow from a Custom Record Page Button

          Add a custom button to a record page that starts an active autolaunched flow or screen flow. Send any variable value to the flow. Use the flow's web address (URL) to set up the button.

          Required Editions

          View supported editions.
          User Permissions Needed
          To open, edit, create, activate or deactivate a flow using all flow types, elements, and features available in Flow Builder, including Einstein and Agentforce for Flow: Manage Flow

          Create a Flow

          Create an autolaunched flow or screen flow to launch from the button. Optionally, you can send the ID of the record where the button is clicked to the flow. To send the record ID to the flow, so the flow knows what record to work on, create a flow variable called recordId to hold the ID.

          1. Open the Flows list view.
            • From Setup, in the Quick Find box, enter Flows, and then select Flows.
            • From the Automation app, select the Flows tab.
            • From the Flows tab in any Lightning app, click the actions menu and select Open Flow.
          2. Create an autolaunched flow or a screen flow.
            1. From the Lightning app, click New. Then select Autolaunched Flow (No Trigger) or Screen Flow.
            2. From Setup, click New Flow. Then select Autolaunched Flow (No Trigger) or Screen Flow.
            Flow Builder opens.
          3. Optionally, add a text variable to store the record ID.
            1. To open the Toolbox, click Toolbox icon..
            2. Click New Resource, and then select Variable.
            3. For API Name, enter recordId.
            4. For Description, enter Stores the ID of the record that the button is located on. This value is passed into the flow.
            5. For Data Type, select Text.
            6. Select Available for input.
            7. Click Done.
          4. Optionally, add more variables to store additional input values that are sent to the flow when it runs. Learn about adding input values, in addition to the record ID, to the URL in Send Variable Values to a Flow Using the Flow's URL.
          5. Add elements to your flow to perform the actions you want.
            For example, if the flow has the ID of the contact sent into the flow, you can use a Send Email action to email the contact by setting Record ID to the recordId variable.
          6. Save the flow.
          7. Test the flow by clicking Debug and using test data.
          8. Click Activate.

          Get Your Flow's URL

          1. From Setup, in the Quick Find box, enter Flows, and then select Flows.
          2. For the flow that you want to run, click Show actions, and select View Details and Versions.
          3. Copy the flow's URL.
            The format of the URL is /flow/My_Flow.

          Create a Custom Button

          1. From Setup, click Object Manager.
          2. Click the object that you want to add a record page button to. For example, Contact.
            The object window opens.
          3. Click Buttons, Links, and Actions.
          4. Click New Button or Link.
          5. Give the button a label and name.
          6. For Display Type, select Detail Page Button.
          7. Leave the default values for the remaining fields.
          8. In the large text box, enter your flow's URL, and then add /lightning to the start of the URL.
            The full text looks like /lightning/flow/My_Flow.
          9. If you want to pass the ID of the record that the button is located on, add the value of the recordId input variable in the URL. For example, if the button is located on account records, enter ?flow__recordId={Account.Id}. So the full URL is /lightning/flow/My_Flow?flow__recordId={Account.Id}.
          10. Save your work.
          Note
          Note We recommend using Lightning experience and adding /lightning to the beginning of your flow URL. However, if you don't add /lightning to the flow URL, it still works, you just don't get the new benefits of running in Lightning. To learn more, see Choosing Between Lightning and Non-Lightning Flow URL Formats.
          An open custom detail page record button configuration window showing the selections described previously
          Note
          Note Optionally, you can customize what happens when the flow ends. To learn more, see Customize Flow Finish Behavior.

          Add the Custom Button to the Page Layout

          1. Click Page Layouts.
          2. Click the page layout that you want to add the link to.
          3. Click Buttons.
          4. Drag and drop your button from the buttons list to the object detail section. For example, the Account Detail section.
          5. Save your work.

          Now, users can go to a record, click the button you created, and start the screen flow or autolaunched flow. If you set up input variables, those values are sent to the flow when the user clicks the Next button on the screen flow or when the autolaunched flow starts running.

           
          Loading
          Salesforce Help | Article