Flow / Admins

5 Advanced Flow Concepts for Salesforce Professionals

By Tim Combridge

It should come as no surprise that Flow is my favorite aspect of Salesforce’s offerings. It is a feature that has provided incomparable value for so many admins and functional professionals over the years. Salesforce has also continually provided updates and enhancements to the tool and will continue to do so for many years to come.

You may be someone who has learned about Flow and loves the benefits it can provide to your business but is looking to step up your game and do more with it. Look no further – I’ve got you covered.

We’re about to talk about some slightly more advanced concepts that every admin should learn if they want to add even more value to their business using Salesforce Flow. Let’s dive in!

Firstly, Back to Basics…

Before we continue, it is assumed that you’re quite familiar with the basics of Salesforce Flow and have used it quite a bit in your day-to-day work. You should be familiar with how to navigate the tool and the different types of flows and be aware of the best practices and anti-practices that you should follow and avoid.

However, just to make sure that we’re on the same page before we proceed, here are some foundational points to keep in mind.

Types of Flows

At the core, there are three types of flows: Triggered (Record-Triggered, Platform Event-Triggered, Schedule-Triggered), Autolaunched, and Screen Flows.

  • Triggered Flows should be used when you want something to happen when another event happens.
  • Autolaunched Flows should be used when you want to capture a series of actions that can be called from another Flow or tool, such as Apex.
  • Finally, Screen Flow should be used whenever you need to interact with your end users.

There’s one that I’ve left out on purpose – Flow Orchestrator. Orchestrator is an extremely unique tool that is built differently from other flows. Instead of building out functionality using Elements, you’d build it by stringing other flows together in stages and steps to create a multi-step, multi-user Flow.

Important Flow Elements

Flow Elements can similarly be grouped into categories – Interaction, Logic, and Data.

Interaction Elements are those that either interact with users or another area of Salesforce and are primarily made up of screen elements (user interaction), actions (interact with other features such as Apex), and subflows (interact with another Flow).

Logic Elements are those that allow your Flows to run dynamically depending on the data that sits within your variables. Decisions, assignments, and loops are examples of these elements.

Last but not least are the Data Elements. These elements are used to execute DML (Data Manipulation Language) statements and will push and pull data between the database and your Flow.

READ MORE: Salesforce Flow Cheat Sheet & Examples [Infographic]

Minimize Pink Elements (DML)

The pink data elements should be used sparingly. I always use the analogy of a wall – every time you use a data element, you’re putting a hole in the wall. Eventually, and with enough holes, the structural integrity of your wall will fail, and your users won’t be able to do what they need to do.

Use Collections and Loops for Bulk Data Management

If you’re working with multiple records at once, you should consider using Collections to group similar records together for processing. Loops allow you to process or assess these variables individually from within a collection.

You can also use a collection with a data element, which allows you to process multiple records at once. If you have 100 records to create, rather than 100 individual create elements, you should use a single create with a collection variable.

Use “recordId” Record Variable Instead of a Query

Did you know that Flow now supports the ability to receive an entire record using recordId? Instead of parsing just the Id of a record and then needing to query it, you can simply create a record variable called “recordId” and enable that for input. The whole record will be parsed instead.

I’ve got a habit of passing the Id from a record into the Flow using the recordId special variable, and then querying the rest of the record (i.e. the other fields) after the fact. I guess old habits die hard!

Flow Is Not the Only Tool!

As wonderful as Flow is as a tool, you need to remember that it’s not the only tool at your disposal.

If you need to create complex actions or work with key-value pair collection types, for example, you should use Apex. If you’re an Industries customer and are looking for complex, branded forms that pull input from multiple sources, you could consider OmniStudio. If you’re looking to embed a fancy new component into your Lightning Pages and Flow just isn’t doing what you need it to do, you could use a Lightning Web Component (LWC).

1. Subflows

Putting it as simply as possible, subflows are flows that are launched by another Flow. They’re built specifically with actions and functionality that are required across multiple flows, and they’ll benefit your business by ensuring you don’t need to be building the same functionality in multiple places.

For example, if you have a process of logging errors in your org by sending an email, posting to Chatter, and sending information off-platform, you could create a single Autolaunched Flow and call it from any other Flow that needs this same functionality. You’d just need to ensure that your subflow has input variables for relevant information so that it can run dynamically.

Remember that a subflow that is called by any parent Flow is done so within the same transaction, so your single transaction’s governor limits will apply to both flows.

2. HTTP Callouts

For many years, Flow was almost solely used to perform actions within the Salesforce platform. You could create Screen Flows to interact with users and Triggered Flows to respond to certain stimuli, but there wasn’t an easy way to interface with external systems or push data beyond Salesforce without code. That was until Salesforce introduced HTTP Callouts.

HTTP Callouts are used to either send or receive data between your Flow and an external system, which makes for an easy way to create simple integrations between Salesforce and other tools. You’d need to configure a named credential so that Salesforce can connect with the external service, but this can also be done without code and doesn’t take very long.

Once complete, you’ll be able to create an HTTP Callout from the “New Action” button in your Flow. Rather than selecting an action from the list, you will need to click the “Create HTTP Callout” button to configure it.

3. System Context

BEFORE WE PROCEED, I am going to quote Uncle Ben (the one from Spiderman, not Salesforce Ben in this case): “With great power comes great responsibility”. This functionality, if implemented incorrectly, can be VERY dangerous. Please proceed with caution.

Buried in the Advanced Menu in your Flow Properties is an option to select how the Flow will run. This is where you’re given the option to run your flows in “System Context” and either enforce sharing rules or exclude them (I’m sure you can now see why I thought it best to put a warning before this section).

“System Context Without Sharing” enables your users to access any data in your org, regardless of their security settings. This can be extremely helpful if done right but can cause irreparable damage to your data and potentially even your company’s reputation if done wrong.

4. Flow Access

Flowing on from the last section (eh, see what I did there?), you should also consider who is accessing Flow in your business from any perspective and whether they actually need as much access as they have. Keeping in mind the Principle of Least Privilege, you should only give your users access to what they need to do their jobs.

This is where the Flow Access functionality comes in. Each Flow can be configured to only be exposed to users with specific profiles or permission sets. This gives admins the ability to give granular access to only the specific flows that users need.

5. Custom Components and Third-Party Offerings

Last but not least, Salesforce Flow can be expanded upon using Lightning Web Components. There are a number of great components that you can download from the AppExchange or other open-source repositories if you’re looking for something specific (take the Data Table component from UnofficialSF, for example, and learn more about how it differs from the standard component).

READ MORE: Salesforce Flow Data Table: Standard vs. Custom

If you’re adventurous and have the right knowledge to do so, you could also consider creating your own custom Lightning Web Components. Depending on the needs of your business, you may find that the standard Flow components just aren’t doing what you need them to do.

AppExchange also has an entire section dedicated to custom Flow solutions that you can pull into your org as required. Rather than building flows from scratch, you may find that you can save some time by using what someone else has already created!

Summary

Your Flow journey is never finished. There are always exciting new features with each release, new concepts or approaches to a problem that you may not have thought of, and new features that you’ve not mastered yet.

The above are just five advanced concepts that you may not have learned before, but this is not a finite list – there’s always more to learn about Salesforce Flow!

The Author

Tim Combridge

Tim is the Managing Director at Sensible Giraffe, passionately educating others via high-quality blog content and training courses including the Ultimate Salesforce Flow Foundation Course.

Leave a Reply