Skip to main content
SFDC Developers
Flow

Salesforce Flow Resources Explained for Developers

Vinay Vernekar · · 4 min read

Salesforce Flow Resources are the foundational components that provide memory, flexibility, and dynamic calculation capabilities to your automated processes. While Flow Builder's canvas is populated with visual elements, resources operate in the background, powering the logic and data manipulation.

Core Flow Resource Types

Variables

Variables act as placeholders for data that can be used and modified throughout a flow. Similar to algebraic variables, their values are not fixed and can change as the flow executes. They are essential for storing temporary data, passing values between elements, and managing dynamic information.

Supported data types include:

  • Text
  • Record
  • Number
  • Currency
  • Boolean
  • Date
  • Time
  • Date/Time
  • Picklist
  • Multi-Select Picklist

Example: A Text variable named accountId can store a record ID, serving as a reference point for subsequent operations.

Collection Variables

Collection variables are designed to hold multiple values or records, functioning like a container or list. To create one, select the "Allow multiple values (collection)" option when defining a variable. A crucial constraint is that a collection can only store values of a single data type (e.g., all Text values or all Account records). This resource type is powerful for processing multiple records simultaneously, such as updating the status of all Cases related to a specific Account.

Constants

Constants, akin to their algebraic counterparts, store fixed values that do not change during the flow's execution. Once defined, a constant's value is applied wherever it's referenced. If an update is required, modifying the constant in one place propagates the change across all its uses.

Example: A Text constant named SupportEmail can store a company's standard support email address. Any changes to this address only need to be made in the constant's definition.

Formulas

Formulas in Salesforce Flow mirror the functionality of Salesforce formula fields. They dynamically calculate values based on other data available within the flow, enabling your automations to perform calculations without hardcoding static results.

Example: Create a formula to calculate a follow-up date by adding 30 days to the current flow execution date, or to compute a discount amount by multiplying a rate by an Opportunity Amount.

Text Templates

Text templates allow for the creation and reuse of text blocks, which are particularly useful for constructing email bodies or setting record descriptions. They support merge fields for personalization.

Example: Build a reusable greeting template that includes the {!Contact.FirstName} merge field to personalize messages sent via a "Send Email" action.

Stages

Stages are primarily used in Screen Flows to visually indicate a user's progress through a guided process. They work in conjunction with progress indicators on Screen elements to inform users of their current step and overall advancement.

Choices

Choices represent options presented to users within a Screen Flow, typically configured for radio buttons or picklists. Beyond individual choices, Flow offers resource types for managing sets of options:

  • Picklist Choice Set: Populates choices directly from an existing picklist field on a Salesforce object.
  • Record Choice Set: Generates choices from a filtered list of records. Filters define the record selection criteria, and each qualifying record contributes a choice based on its field values.
  • Collection Choice Set: Similar to Record Choice Set, but derives the list of records from a record collection variable or external data sources.

Key Takeaways

  • Salesforce Flow Resources are critical for building dynamic and flexible automations, providing memory and calculation capabilities.
  • Variables store data that can change, while Constants store fixed values.
  • Formulas enable dynamic calculations within the flow logic.
  • Text Templates streamline the creation and management of reusable text content.
  • Collection Variables, Stages, and Choices offer specialized functionalities for handling multiple data points, guiding user interaction, and presenting options within flows.

Share this article

Get weekly Salesforce dev tutorials in your inbox

Comments

Loading comments...

Leave a Comment

Trending Now