Salesforce Flow Quick Reference Guide
Salesforce Flow Quick Reference Guide
Flow Types the record is updated to meet the specified criteria (e.g.
Only run when an Opportunity StageName is updated to
● Formula - Computes a value using a formula, just like a
formula field. Use merge fields to refer to other Resources
When creating a Flow you’ll be prompted to choose a type to “Closed/Won”) from the Flow.
determine how the Flow executes. ● Optimizations - If you plan to use the Flow to do ● Text Template - Create a template using merge fields with
calculations using just the fields in $Record or optional formatting. Great for email bodies.
● Autolaunched (No-Trigger) - Called by Process Builder,
$Record__Prior and then update fields on $Record without
another Flow or Apex code. No UI capability.
accessing anything else, use “Fast Field Updates”. Choice Types (Screen Flows Only)
● Screen - Runs insides Salesforce Lightning experience and
Otherwise, use “Actions and Related Records”. Used by UI components like picklists to display a list of options
provides a user interface. Can be executed by UI
● Scheduled Paths - Sometimes, you need to execute some to the user. Choices have a label that’s displayed to the user for
components like buttons.
steps after a certain amount of time has elapsed (e.g., each option and a value that’s stored in the Choice Resource
● Record-Triggered - Runs when a record is created,
update a Lead after some external service has enriched it) once the user makes a selection.
updated or deleted. No UI capability.
or at some relative time in the future (e.g., 24 hours before
● Schedule-Triggered - Runs on a predefined schedule. No ● Choice - Manually specify options.
this Task is due). Scheduled paths allow you to do just that.
UI capability. ● Record Choice Set - Provide options from a list of records
● Platform Event-Triggered - Available in Enterprise Edition (e.g. a list of Contacts related to an Account)
and up. Runs when a Platform Event is delivered. No UI Resources ● Picklist Choice Set - Provide options from a Picklist field on
capability. an existing Object (e.g. Opportunity stages)
Resources store data. They’re a little like custom fields used by
the Flow. Like a field, you need to give Salesforce some info
Record-Triggered Flow Config about what you want. Data Types
Record-Triggered Flows run whenever data changes and require Data Types are used in various ways to tell Salesforce what kind
extra configuration to define their starting conditions and Resource Types of data a Resource will contain.
execution paths. Each Flow relates to a single Object type. The
The Resource Type controls how a Resource can be used. Data ● Text - Any characters, numbers, etc. No size limit.
record which triggered the flow is available as a resource called
Types control what a Resource can contain. ● Record - A record from a specific Object. You’ll need to
$Record. Below are other configuration options:
specify the Object type as well. (e.g. Lead, Account)
● When - Choose created; updated; created or updated; or Available to All Flow Types ● Number - A numeric value with a certain number of decimal
deleted. If you choose “created or updated”, you will have ● Variables - Holds a value that you can set in your Flow and places.
access to both $Record and $Record__Prior which contains then retrieve later. ● Currency - Similar to Number but for money.
the state of the record before the changes that triggered ● Constant - Set this value once and it doesn’t change. ● Boolean - Contains true or false. When setting Boolean
the Flow. Useful for “hardcoded” values that might need to change, resources, use $GlobalConstant.True or
● Entry conditions - Specify specific conditions a record like the name of a record type. $GlobalConstant.False.
must meet to trigger the Flow. For Flows triggering on ● Date - A day without a time value.
updates, you can also choose to run the Flow only when ● Date/Time - Both a date and time.
Salesforce Flow Quick Reference by Gradient Works • Page 1
● Apex-Defined - An instance of an Apex Class. You’ll need ● Action - Actions allow you to reuse logic provided by Create Records
to specify the Apex Class as well. The Apex Class is similar someone else. Salesforce provides built-in actions for
You can create one or more records of a specific Object type
to a Custom Object and the Resource is similar to a Record things like sending an email. You can build your own using
using this Element. The behavior differs if you’re creating one or
from that Custom Object. Apex or use certain managed packages that provide
multiple:
Actions. (e.g. Gradient Works provides actions to perform
Additional Variable Config round-robin assignments or lead matching.) ● One - You can choose to save a single Record Resource to
Variables have some extra options that control how they can be ● Subflow - Execute another Flow from the current Flow. set Record fields, but the most common option is to set
used inside and outside the Flow. Combine this with Input and Output variables to create specific field values using separate Resources. When
Flows you can reuse from multiple places. creating one record, this Element provides an output that
● Allow multiple values (collection) - Flow variables hold contains the Id of the newly created record.
either a single value of a given Data Type (e.g. the text ● Multiple - Specify a Record Collection Variable that
“Foo”) or a collection (aka a list) of values (e.g. “Foo”, “Bar”,
Logic
contains the unsaved Records to create. After this Element
“Baz”). Collections are especially useful for holding multiple ● Assignment - Set the value of a Variable Resource or a executes, all records will have ids assigned.
records. field on a Record Resource. You can perform multiple
● Availability Outside the Flow - Variable Resources may be assignments in a single Assignment action. Update Records
used as “Inputs” provided to the Flow by some other ● Decision - Choose one or more Outcomes (execution
Use this Element to ensure records you’ve previously created or
process (e.g. another Flow, Process Builder or a UI action). paths) for the Flow to execute based on specific criteria.
modified in the Flow are saved. It also provides a mode to set
They may also be provided by the Flow as “outputs” (e.g. ● Loop - Loops allow you to run some Elements for each item
fields on records “in place” without first loading them into the
one Flow may use a Subflow Action to have a 2nd flow in a Collection Variable. Think of Loops as a special kind of
Flow via Get Records.
compute a value). Decision that checks to see if you’ve processed all items in
the Collection. If you haven’t, the Outcome is to run through ● Use a Record or Record Collection - Specify the Record or
the same Elements again. Once you have, go on to the next Record Collection Resource you want to update. Any field
Elements Elements. values those Records contain will be saved.
Flow Elements control what the Flow does and in what order. ● Collection Sort - Sorts the items within a Collection. If ● Use Conditions to Set Fields - Perform an update without
You connect elements to each other to describe a series of those items are Records, choose which fields to use for loading the records first. This updates any records in
steps that build on each other — the outputs of one step can be sorting. You can also use this to truncate a collection to a Salesforce that match the specified conditions, setting their
used as inputs to another step. This allows you to create certain number of items. fields to the specified values. Be careful.
complex “programming” without using code. There are three ● End - Does just what you think it does; ends the Flow right
major categories of Elements: Interactions, Logic and Data. then and there. Get Records
Use this Element to retrieve one or more records based on
Interactions Data specific criteria. You can choose to store “Only the first record”
or “All records”. Depending on your choice, you can refer to the
● Screen - Build a fully interactive UI in Lightning Experience. There are four Data Elements: create, update, get and delete. Element API name later to access a single Record or a Record
Use this Element to create forms to capture data or screens These are the most complicated Elements and have various Collection, respectively. If you only get the first record, be sure
to display it. options to support different use cases. to set the Sort Order if there’s the possibility more than one
record might match your criteria.
If you’re not using Data Elements within a Loop but are still
seeing DML limit issues from a Record-Triggered Flow, your
Flow is probably running for too large of a batch during a data
import. Consider either a) reducing the batch size in Data
Loader or b) using a Scheduled Path which allows you to control
the batch size from within the Flow.