How to Use the Action Button Component in Screen Flow

How to Use the Action Button Component in Screen Flow

Salesforce introduced the Action Button component in the Summer '24 release. This game-changing feature allows you to run autolaunched flows directly from flow screens. Unlike running subflows, it is possible to run autolaunched flows without leaving the screen. Moreover, you can get outputs from the flow and use them within your screen.

Game-changing features often come with complex configuration requirements. Surprisingly, configuring this component takes just a few clicks. Here's a guide on how to use the Action Button component in a screen flow.

Let's use the Action Button to get the related Case and Contact records of the selected Account.

Configuring the Action Button Component

1- Build an autolaunched flow that gets the related Case and Contact records of the Account. In order to do that, create an input text variable for the Account Id and output record collection variables for Case and Contact.

Input Variable
Output Variable

Your flow should look like this.

Autolaunched Flow

2- Build a new screen flow with any kind of record selection (picklist, radio button, data table, lookup, etc.). Let's use a lookup component to choose an Account record.

Lookup Component

3- Add an Action Button component to the screen. Give it a name and choose the autolaunched flow that you want to call.

Adding the Action Button Component

Pass the selected Account's Id as an input value. As you can see, it displays the output variables of the autolaunched flow.

Passing an input value to an autolaunched flow

4- Let's add data table components to display the output variables of the autolaunched flow.

Data Table to Display the Outputs

For the source collections, use the outputs of the component (Cases and Contacts are record collections).

5- At the end, your screen will work like this.

Action Button Demo

Action Button Component with HTTP Callout

It is possible to use the Action Button component to make an HTTP Callout too. Just build an autolaunched flow that makes the callout and returns the output to your screen.

For example, here is a screen flow to create a Lead record in Salesforce. Action Button passes the email address to an autolaunched flow that makes an HTTP callout to validate the email.

Autolaunched Flow with HTTP Callout
Action Button and HTTP Callout

Pay attention that there is a disabled checkbox field on the screen. It becomes true if the email is valid. Additionally, there is a validation rule in place that prevents the user from proceeding if the email is invalid.

Checkbox Configuration

At the end, it works like this:

Action Button - Email Validation

Summary

Salesforce introduced the Action Button component in the Summer '24 release. It is a game-changing feature that allows you to run autolaunched flows directly from flow screens. This functionality opens up a world of possibilities!

Be the first to comment

Leave a Reply

Your email address will not be published.


*