Do you often feel stuck managing tedious manual tasks in Salesforce? You’re not alone! Many users find it hard to make their processes smoother. In this blog, I will share a newly released Salesforce feature in Flow that can help simplify your workflows, improve user experience, and increase productivity.
Salesforce introduced the Action button component feature in its Summer 24 release to make screen actions reactive. Previously, this was released as a beta version, and now, in Winter ’25, its full version is released. Action buttons make tasks quicker by performing actions straight from the flow screen, provide a more user-friendly interface that’s easy to navigate, and create adaptable workflows by mixing various flow elements together.
Action button with an example!
To make this process easier, we’re creating a simple workflow. First, we’ll fetch all the contacts linked to a specific account. Once we have all the contacts displayed, it becomes much easier to review them. You’ll be able to see names and other details at a glance. This user-friendly view helps you quickly identify which contact you want to set as the primary.
After you’ve selected the right contact, the next step is to update the Primary checkbox as true. This can be done with just a click of a button, saving you time and effort compared to manually updating each record.
Finally, once the contact is marked as primary, we’ll show a confirmation message. This little piece of feedback lets you know that the update was successful, ensuring you feel confident in your actions.
Flow Execution
The approach is creating two auto-launched flows. One is for fetching related contacts, and the other is to assign the primary contact. These two flows would be called using an action button from the screen flow. Let’s see what I have done.
Step 1- Create an Autolaunched flow(Contact - Get Contacts) which will get all related contacts of an Account.
-> Create two variables. First will store the account ID through which we need to fetch all the contacts and second is a collection variable where we will store all the contacts.
-> Now add a get record element in the flow which will get all the contacts related to the accountId. Store all the contacts in the collection variable and choose the field that you want to display on the screen.
Step 2 - Create another auto-launched flow(Contact - Set Primary) that will get the selected contact and update the contact as primary.
-> First, create a variable that contains a selected contact ID, to which we have to make it primary.
-> Add a get record element in the flow which will fetch the selected contact record.
-> Again add an update record element which will update the primary checkbox of the contact as true.
Save the auto-launched flow.
Step 3 - Now the last and most important step is creating another screen flow on which we can see the newly launched action button functionality.
-> Create a variable that will store the current account ID.
-> Add a screen component in the flow.
-> Add a display text component to display the label.
-> Now add the action button which will call the first autolaunched flow to get all the contacts related to that account.
Provide the API name of the action button.
Configure the action here. I am assigning the action to call the auto-launched flow to get all the contacts bypassing the record ID to the variable accountId which I created on the auto-launched flow to take the current account ID as a parameter.
In the view output resource, we can see the contactCollection variable where we are storing all the contacts.
-> Now add a Datatable component to display the contacts and select the collection to show contacts.
-> Configure the columns you want to display on the data table and set the visibility of the data table.
-> Now add another action button component which will call the second autolaunched flow and update the selected contact as primary.
-> Set the action button visibility only to be visible after the user selects any contact from the data table.
-> At last add a display text for the success message after the contact update and set visibility only visible after the successful process of contact updation.
Save the flow(Flow name: Account - Primary Contact Screen) and activate it.
Now add our flow on the Account record page.
In the builder, locate the Flow component in the left sidebar and drag it to the desired section of the page layout.
Test the flow
Conclusion
By effectively utilizing the action button component, you can significantly enhance your Screen Flows, making them more efficient and user-friendly. Action buttons are a valuable tool that significantly enhances user efficiency within the Salesforce platform. They allow users to create, update, and execute auto-launched flows to execute other processes without switching between multiple screens, saving time and simplifying everyday tasks. These buttons can be customized to meet specific business needs, making automating routine processes and maintaining data quality easier.
Happy Coding! Please leave a comment to help me understand how the blog helped you. If you need further assistance, please get in touch with us. You can also click "Reach Us" on the website and share the issue with me.
Reference
Blog Credit:
A. Rawani
Salesforce Developer
Avenoir Technologies Pvt. Ltd.
Reach us: team@avenoir.ai
Comments