3.3 Declarative Programming with Flows
With retirement of Process Builder and Workflow Rules, the creation of new processes is limited. So now, new processes can only be created using Flow.
The Migrate to Flow is an official tool provided by Salesforce to assist with the migration of workflow rules to flows. It is designed to help users transition their existing workflow rules and processes to the newer flow automation tool in Salesforce.
Go to Setup ➤ Type “Migrate to Flow” in the search field on the left menu. Flows is a tool within the Salesforce platform that allows to automate complex
business processes. It collects data and performs actions based on that data. Flow Builder is the declarative interface used to create individual flows, enabling users to build code-like logic without using a programming language. Some of the key benefits include
Automating Business Processes: Salesforce Flow allows users to automate complex business processes by collecting data and performing actions based on that data. It provides a visual interface for defining the sequence of steps and conditions, making it easier to create custom workflows that guide users through tasks efficiently and consistently.
Collecting and Updating Data: Flow enables to collect and manipulate data without the need for coding. It provides variables to store and manipulate data throughout the flow, and actions to perform specific activities such as creating records or updating fields. This allows to streamline data collection and update processes within the Salesforce platform.
Integration with Other Salesforce Features: Salesforce Flow can be seamlessly integrated with other Salesforce tools and features. This integration capability allows to leverage the full power
of the Salesforce platform and create comprehensive process automations.
User Interactions: Flow provides the ability to create quick screens for user interactions. This allows end users to input data and interact with the flow, making the automation process more user-friendly and intuitive. Users can create screens with input fields, picklists, checkboxes, and other components to gather the necessary information for the process.
Code-Free Automation: One of the major advantages of Salesforce Flow is its declarative nature, which means users can build code-like logic without the need for extensive coding knowledge. This empowers to create powerful process automations without writing complex code, making it accessible to a wider range of users.
Salesforce offers different types of flows that cater to various automation needs. See the available types of Flows on the following diagram. Each type of flow serves a specific purpose and can be used to automate different aspects of business processes within the Salesforce platform.
Screen Flows are a type of flow that allows you to create interactive, guided experiences for users. They’re designed to gather and display information from users in a step-by-step manner, guiding them through a series of screens to accomplish a specific task or provide information. Screen Flows are particularly useful for creating user-friendly data entry forms, wizards, and self-service processes. Here’s how Screen Flows work and their key features:
•\ Interactive Steps: Screen Flows are composed of individual screens that users interact with. Each screen can present information, ask for input, and guide users through a specific action.
•\ Visual Design: Flow Builder provides a drag-and-drop interface for designing the layout and content of each screen. You can arrange fields, buttons, images, and text to create a visually appealing and user-friendly experience.
•\ Input Elements: Screens can include various input elements, such as text fields, picklists, buttons, and checkboxes. Users can provide data directly within the flow.
•\ Data Validation: You can apply validation rules to the input fields to ensure that users provide accurate and complete information. If a user enters invalid data, the flow can display error messages.
•\ Conditional Logic: Screens can use conditional logic to dynamically show or hide components based on user selections or previous inputs. This helps create a personalized experience.
•\ Navigation and Flow Control: You can define the flow’s behavior by adding decision elements that determine which screen to display next based on user inputs. This enables you to create branching paths within the flow.
•\ Record Creation and Updates: Screen Flows can create new records or update existing records in Salesforce. Users can enter data, which the flow uses to populate fields in the target record.
•\ Integration: Screen Flows can integrate with external services, APIs, and databases to fetch or send data as part of the flow.
•\ Guided Experience: Screen Flows guide users through a series of sequential steps, reducing the risk of errors and ensuring a consistent process.
•\ Mobile and Lightning Experience: Screen Flows are optimized for mobile devices and Salesforce Lightning Experience, making them suitable for both desktop and mobile users.
Some examples of use cases for Screen Flows include
•\ Data Entry and Updates: Use Screen Flows to create intuitive data entry forms for users to create or update records.
•\ Self-service Processes: Build self-service wizards that guide customers through tasks like submitting support requests or updating their account information.
•\ Lead and Case Qualification: Create guided processes to qualify leads or cases based on specific criteria and user input.
•\ Employee Onboarding: Design onboarding processes that guide new employees through providing information and completing necessary forms.
Record-Triggered Flows are a type of flow that are initiated and executed in response to changes made to records. Unlike autolaunched flows that are programmatically triggered, record-triggered flows are directly associated with specific objects and are triggered when records of those objects are created or updated. They are designed to automate processes and actions that are closely tied to record changes, allowing you to perform complex logic and updates. Here are the key features for Record-Triggered Flows:
•\ Record-Driven Execution: Record-triggered flows are started by the creation or modification of records of a specific object.
•\ Real-Time Automation: These flows can respond to changes in real time, allowing you to implement immediate updates and actions based on record changes.
•\ Change-Based Logic: You can define different logic and actions to occur based on the values of fields before and after the record change.
•\ Before-Save and After-Save Logic: Record-triggered flows can be set to run either before or after the record is saved, giving you control over when the flow’s actions occur.
•\ Complex Logic: Implement complex decision-making, branching, and multiple actions within a single flow based on the record’s changes.
•\ Updates and Notifications: Use record-triggered flows to update related records, send notifications, create tasks, and perform other actions based on the changes.
•\ Integration with Apex: You can invoke record-triggered flows from Apex triggers, or other flow types to create a comprehensive automation strategy.
Some examples of use cases for Record-Triggered Flows include
•\ Field Updates: Automatically update related fields or records when specific fields change on a record.
•\ Validation and Data Cleaning: Implement complex data validation rules that check multiple fields and conditions before allowing a record to be saved.
•\ Approval Workflows: Implement customized approval processes and notifications based on changes to approval-related fields.
•\ Notification and Follow-Up: Automatically send emails or notifications to users or customers based on changes to records.
•\ Cascade Updates: Update related records when a parent record changes, ensuring data consistency.