What is Salesforce Flow and How to Create It?

Salesforce Flow

Salesforce Flow is a powerful automation tool in Salesforce that allows users to build guided processes in Salesforce. A flow looks very much similar to a flowchart. Basically, flow builder is used for creating flows in Salesforce. Flow builder is a primary and declarative tool that does not require any coding knowledge to create and manage flows. Users who don’t have any coding skills can also use this tool. Users can use Flow to perform different tasks and operations such as creating, updating, deleting records, sending email alerts, and many more processes.

We can also create a flow by converting the Salesforce workflow rules and process builder into a flow. We can perform this flow conversion using Migrate to Flow tool.

Create a Salesforce flow using Flow Builder

Suppose, you want to create a contract for Closed Won opportunities. In this article, we will use a record-triggered flow because it triggers when a record is created or updated. The requirements of the flow are in three parts: trigger, criteria, and action. Whenever an Opportunity record is created or updated (trigger) and its status is Closed Won (criteria), then create a Contract record with draft status (action). To create a record-triggered flow in Salesforce, follow these steps:

Configure the Start of the Salesforce Flow

Step 1: On the Setup page of your Salesforce Org, enter “Flows” in the Quick Find box, and then select Flows.

Step 2: Here, click the “New Flow” button to start the creation of the flow. This redirects you to the Flow Builder page.

Step 3: Select “Record-Triggered Flow” and then, click “Create“. Then, a configuration window will open.

Salesforce Flow

Define the Trigger of the Flow

Step 1: In the Object field, select Opportunity and, select “A record is created or updated” for “Trigger the Flow When:” in the trigger section. This makes the flow run when a user either creates or updates a record.

Step 2: Select “All Conditions Are Met (AND)” for the Condition requirements.

Step 3: Now, define the condition as StageName equals Closed Won and click the “Done” button. It will display the flow canvas.

Salesforce Flow

Create a draft Contract record

Step 1: On the flow path, hover over the small circle after the Start element and click the “+” icon, and select the “Create Records” element.

Step 2: For Label, enter “Create a draft Contract“. The API Name field will automatically update its value to “Create_a_draft_Contract“.

Step 3: For How Many Records to Create, select One. And for How to Set the Record Fields, select Use separate resources, and literal values.

Step 4: Now, select “Contract” in the Object field.

Step 5: Under Set Field Values for the Contract, select AccountId for Field, and then for Value, select $Record > Account > Id. The field automatically updates to $Record > Account ID > Account ID.

Step 6: Then, click the “Add Field” button to add another field.

Step 7: Here, select Status for Field and, select Draft for Value. Then, click the “Done” button.

Salesforce Flow

Step 8: Now, click the Save button. Provide a Label for the flow, the API name for the flow will update according to the Label.

Step 9: Then, click the Save button to save the flow. Also, click the Activate button to activate the flow.

After you activate the flow, the flow will trigger when you create or update an opportunity record. If the StageName field’s value is equal to Closed Won then the flow creates a Contract record. The created Contract record’s Status is Draft and the AccountId is as same as the Id of the related Opportunity.

Please contact us at manish@bay20.com or call us at +91-8800519180 for any support related to Salesforce. You can also visit the Salesforce development page to check the services we offer.