Press ESC to close

How to SalesForceHow to SalesForce Expert Salesforce Advice for Aspiring Developers, Admins & Beginners.

A Guide to Salesforce Flows

As humans, we often wish for tasks to be completed effortlessly, almost like magic. While this isn’t feasible in reality, Salesforce understands our desires and has taken steps to automate tasks for us. This includes actions like sending emails or notifications upon specific events and automatically updating records. It’s as if Salesforce is performing these tasks for us automatically, thanks to its suite of automation tools.

Read out my latest blog related to Salesforce Developer Versions.

Salesforce offers triggers, process builders, workflows, and flows to accomplish this. Additional tools may simplify automated operations in the future. Salesforce announced that Workflow Rules and Process Builder will be discontinued after December 31, 2025. Flows are a codeless automation option, especially for non-coders. In this blog, I’ll briefly explain Flows and demonstrate their capabilities as a user-friendly Salesforce automation tool.

INTRODUCTION TO SALESFORCE FLOWS

Salesforce Flow is an easy-to-use declarative automation tool that allows you to build complex business automation solutions through point-and-click.

With Salesforce Flows, you can accomplish a range of tasks including sending emails, posting in Chatter, issuing custom notifications, and more. It serves as a trigger for record insertion, updating, and deletion, functioning seamlessly for both before and after events.

Currently, we have following 6 types of flows:

Types of Flows in Salesforce Development

1. Screen Flow

Screen flows are those flows that can guide users through a business process by using custom UI. This flow can be used for user interaction. It can be used to perform any task based on a specific record. Screen flow can include one or more screens consisting of a screen component, configurable, reusable element added to a screen.

2. Record Triggered Flow

Record triggered flow launches when a record is created, updated, or deleted. This auto launched flow runs in the background.

In Record Triggered Flow, you can configure when to execute the actions:

· Fast Field Update (Before Save):

Whenever we need to perform any task on the triggering record before the record is saved, e.g. prepopulating a field or perform a validation before saving the record.

· Actions and Related Records (After Save):

Whenever we need to perform any action after the record is saved, e.g. Create, update or delete any records of related or unrelated objects and perform actions, like sending an email or bell notification.

3. Scheduled Triggered Flow

This flow launches at a specified time and frequency for each record in a batch. This auto launched flow runs in the background. You cannot launch a schedule-triggered flow by any other means. Only the following frequencies can be used to schedule flow from Start Date and Time:

  • Once
  • Daily
  • Weekly

4. Auto-Launched Flow (No Trigger)

Auto launched flow does not require any user interaction, this flow launches when invoked by Apex, Processes, REST APIs and more. This auto launched flow runs in the background.

5. Platform Event Triggered Flow

A platform event-triggered flow will be executed whenever an event occurs in Salesforce. This flow runs in the background without any interaction with the user.

For example, Let’s say we have created a screen flow, and at the time of execution of that screen flow, there is an error. If we want to perform any action whenever an error occurs, we’ll use platform event-triggered flow. Those actions could be storing the details of that error in an object or sending an email about the occurrence of that error.

6. Record Triggered Orchestration Flow

Before understanding this flow, let us first see what orchestration means. Orchestration is a sequence of stages with multiple actions and elements inside them. An orchestration enables you to create a multi-step, multi-user process. Therefore, this flow will be executed or invoked whenever we create or update the record, and based on that, certain stages will be executed. This flow doesn’t get executed on record deletion.

BUILDING BLOCKS OF FLOW

There are 3 main “building blocks” of any Flow:

1. Elements

Elements in a Flow are like Lego blocks that help you do different tasks. These perform logical actions such as assignments, decisions, or loops. There are also data elements that will query the database or commit record changes.

2. Connectors

Connectors determine which element leads to which. Winter ‘21 enables Auto-Layout and connects the Elements together automatically.

3. Resources

Resources are the individual variables of data that are to be used in a Flow – these can be strings of text, numbers, records, formulae, or collections.

You can see these in action on the Flow Canvas below.

Building Blocks of Flows

SALESFORCE FLOWS LIMITS AND CONSIDERATIONS

  • InAPI version 0, the limit of 2000 flow elements were removed. In API version 56.0 and earlier, flows could have a maximum of 2000 flow elements.
  • GeneralFlow Limits:
    • Versionsper flow: 50
    • Activeflows per flow type: 5 in PROFESSIONAL EDITIONS and 2000 in all others
    • Totalflows per flow type: 5 in PROFESSIONAL EDITIONS and 4000 in all others

· Per-Transaction Flow Limits:

  • Totalnumber of SOQL queries issued:
  • Totalnumber of records retrieved by SOQL queries: 50,000.
  • Totalnumber of DML statements issued:
  • Totalnumber of records processed as a result of DML statements: 10,000.

Click here to learn more.

BEST PRACTICES OF FLOWS

To maximize the benefits of Salesforce Flow, it’s crucial to adhere to certain best practices.

  • Planout your flow before you start
  • Buildyour flows in a test environment—like a sandbox or Developer Edition
  • Neverhard-code Salesforce
  • Waituntil the end of the flow to edit the
  • Avoidcreating records before the first screen in the
  • Controlwhen running users can navigate
  • Providean error
  • Saveearly and
  • Test asmany permutations of your flow as you possibly can. Click here to learn more about salesforce best practices.

USE CASE

As we have discussed much about flows, let’s look at a use case to understand much better.

In our scenario, we will utilize the data table component within a ScreenFlow. We aim to display a table containing all related Contacts and Account record detail pages. Subsequently, we will update the phone numbers of the selected contacts.

With the Winter ’23 release, it’s now possible to create flows without needing to search in the quick find box.

Use Case Image 1

I have created a Screen flow and selected datable component on the screen.

Use Case Image 2

1. API Name

This is the API name of the data table.

2. Label

It will automatically get selected from the API name.

3. Use Label as the table title.

The default value if unchecked, and if you check this checkbox, it will use the label you defined as the title of the data table.

Next is the Configure Data Source, the records you would like to display in the table. It will have to be a record collection variable. We also have a option to show a search bar, if we check this, it will display a search bar on the data table.

Configure Data Source Image

The possibility to choose either multiple records, one record, or no selection at all (view only).

Configure Rows, Image

· Minimum / Maximum Row Selection

It only shows up if you allow for multiple selections. You can define how many records the user can choose. As in this example, I have described the minimum selection as 1; if I don’t select any row before moving further, it’ll throw an error, and in case of maximum selection, I have defined three rows, so choosing a 4th row will be unable/ read-only.

· Default Selection

This only shows up if you allow for selection (multiple or single). It only accepts record collection variable. If the records in the default selection do not exist in source collection, this setting will be ignored.

You can configure each column separately. This is to choose which field to display.

Configure Columns, Image

We can also use custom labels for each column, and it will be displayed on the data table. Default Text Overflow Mode defines how the text in column will be shown if the text is too long.

Custom Labels, Image

Here is the entire flow for our use case, which includes the data table in the screen flow.

Entire Flow Chart, Image

FLOW INTERVIEW

Every time a flow is executed, a flow interview starts, representing an instance of that flow. Each interview may take a unique route through the flow and trigger different actions based on the data supplied through input variables or input components on a screen.  You can debug your existing flow directly from Flow Builder to observe how the interview operates. Navigate to Flow Builder and select Debug. Click on Run. Review the debug details; first, the card explains how the interview started (A user started the flow interview), and then it followed the path (actions) in the flow.

Debug Details, Image

NOTE

  1. TheActions and Related Records option is not available in case of
  2. Onlyone version of each flow can be active at a
  3. Someresources, such as global constants and global variables, are provided by the
  4. We should not use any DML operation in before save flows, since you are working on the recordbefore it even goes into the database, you just need to set the field values you want through assignment element and that’s it.

SUMMARY

Today, I have taken you through the basics of Salesforce Flows to answer what Flows are, types of flows, best practices, limitations and so on. The use cases for Flow are endless, and its capabilities are growing with every Salesforce release. In this blog I have shared with you one use case to demonstrate how we can use data table in salesforce screen flow. Hopefully, I’ll dive into more use cases and amazing facts about salesforce in upcoming blogs.

Umema Fayyaz

Umema Fayyaz, with 2.3 years of experience, is a dedicated Salesforce developer at PixelEdge Solutions. She's passionate about using her technical skills to help businesses achieve their goals. She has a strong understanding of Salesforce development best practices and is constantly looking to enhance business processes.