3.4 Flow Components
Salesforce Flow consists of several components that work together to automate business processes. These components include elements, variables, and connectors.
Elements represent the actions that the flow can execute. Elements are connected together to define the flow’s sequence and logic, determining the order in which actions are executed. There are different types of elements available in Salesforce Flow, depending on the type of flow being created. Some examples of elements include
•\ Screen Elements: These elements are used to display screens to users and collect data from them.
•\ Action Elements: Action elements allow users to perform specific actions, such as sending emails, creating records, or executing custom Apex code.
•\ Logic Elements: Logic elements enable users to define conditions and perform branching or decision-making within the flow.
•\ Data Elements: Data elements are used to manipulate and update data within the flow, such as updating record fields or performing calculations.
Variables and resources store and manipulate data throughout the flow. They can hold values, formulas, formatted text, records, or collections of records. Variables and resources allow users to store and reference data at different stages of the flow, enabling data manipulation and decision-making based on stored values.
Connectors define the path that the flow takes as it runs. They connect elements together and guide the flow’s execution from one element to the next. Connectors play a crucial role in controlling the flow’s sequence and determining the path it follows based on the defined logic.
By utilizing elements, variables, resources, and connectors, you can create powerful and customized flows to automate complex business processes within the Salesforce platform. These components work together to collect and update data, interact with users, and define the flow’s logic and execution path.
3.5 Building aFlow
Now, we want to create a simple flow in Flow Builder that automatically creates a new task on the account from the related opportunity based on when the opportunity reaches a Negotiation/Review stage.
Note! Remember that certain features and permissions may vary based on your Salesforce edition, customization, and the organization’s configuration. It is a best practice to develop and test flows in a sandbox environment before deploying them to a production environment. This approach helps ensure the stability and reliability of the flow before it is used in production environment where data integrity and user experience are critical.
Step 1: Choosing a “Record-Triggered Flow” is a suitable choice because Record-Triggered Flows have access to the entire record context, both old and new field values. This allows you to evaluate changes in the opportunity record, such as the stage reaching a certain value. Now click Create button as follows.
Step 2: In the new dialog window, choose Select Object ➤ “Opportunity.”
•\ Configure Trigger ➤ A record is created or updated.
•\ Set Entry Conditions ➤ Condition Requirements ➤ Custom
Condition Logic is Met.
•\ Field ➤ StageName.
•\ Operator ➤ Equal.
•\ Value ➤ Negotiation/Review.
•\ Click Save button on the top right.
Step 3: Put the Flow Label in the field. Flow API Name will be automatically populated. Click Save button.
Step 4: Now click + to add the new element on the canvas. Click Set Records.
Step 5: Put the name Opportunity ID in the Lebel field and API Name will be automatically populated.
Note! Try to consistently name conditions across all elements. This naming convention has a significant impact on the automatic generation of API names for these elements. The importance of this approach will become apparent in the next steps when utilizing API names in the building processes of other elements:
•\ Get Records of This Object ➤ Object ➤ Opportunity •\ Filter Opportunity Records ➤ Field ➤ ID
•\ Filter Opportunity Records ➤ Operator ➤ Equals
•\ Filter Opportunity Records ➤ Value ➤ $Records ➤ Opportunity ID
Step 6: Now click + to add the new element on the canvas. Click Action.
Step 7: Type in the search field “Chatter” and choose Post to Chatter.
Step 8: Put the name Chatter_Message in the Label field, and API Name will be automatically populated.
•\ Set Input Values for Selected Action
•\ Message ➤ {!Opportunity_ID.Name}
•\ Target Name or ID ➤ {!Opportunity_ID.Id}
•\ Click Done Button
Step 9: Now click + to add the new element on the canvas. Click Create Records.
Step 10: Put the name Account_Task in the Lebel field and API Name will be automatically populated.
•\ How Many Records to Create ➤ One
•\ How to Set the Records Fields ➤ Use separate resources and
literal values
•\ Create a Record of This Object Object ➤ Task
•\ Set Field Values for the Task ➤ Field ➤ Subject ➤ Call
•\ Set Field Values for the Task ➤ Field ➤ Whatid ➤ Opportunity from
Opportunity_ID ➤ Account ID ➤ Account ID
•\ Set Field Values for the Task ➤ Field ➤ Description ➤ Opportunity
from Opportunity_ID ➤ Stage
•\ Click on Save As Button
•\ Field ➤ Flow Label ➤ Type “Opportunity review” •\ Click on Save button and save a new created Flow.
•\ Your Flow is created as below.
•\ Click on Activate button on the top to activate the Flow within your Salesforce org.
•\ Check the newly created Flow by building a new Opportunity and changing the Stage to Negotiation/Review.
•\ See the new created task on related account activity.