0% found this document useful (0 votes)
7 views

salesforce tutorials 5

Uploaded by

Ragul S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

salesforce tutorials 5

Uploaded by

Ragul S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

SALESFORCE FLOWS

Salesforce Flows are an automation tool provided by Salesforce


which can be used to perform various tasks like, Sending an
Email, Posting a chatter, Sending custom Notifications &, etc.
Flow is the most powerful automation tool provided by
Salesforce. It can be trigger for record insert, update and record
delete and it can be run for both after and before events.

Uses

1. Streamlines workflows and saves Time: Salesforce Flow automates repetitive tasks and

business processes, freeing up employees to focus on more critical and strategic work.

This business automation can significantly reduce the time spent on manual tasks, such as

data entry or routine communications, thereby enhancing overall efficiency.

2. Improves customer service: By automating processes like customer responses, follow-ups,

and data management, Salesforce Flow helps ensure consistent and timely interactions with

customers. This leads to improved customer satisfaction as their needs are addressed more

quickly and accurately.

3. User-friendly and code-free: Flow Builder’s intuitive, drag-and-drop interface makes it

accessible for users without coding skills. Admins and business users can create and

manage flows easily, reducing the dependency on technical staff and lowering the barrier

to implementing automation solutions.


4. Cost-effective: Developing custom solutions using Apex or other programming languages

requires specialized skills and more resources, making it more costly. Salesforce Flow

offers a more economical alternative by enabling powerful automation without the need for

extensive programming.

5. Flexible and scalable: Salesforce Flow is versatile and can be adapted to a wide range of

business needs, from simple tasks to complex workflows. It’s also scalable, meaning it can

grow and evolve with the business, accommodating changing requirements and increasing

volumes of work.

___________________________________________________________________________

___________________________________________________________________________

STEP 1 Collect Contact Info from Your User


 Captures information from a user.

 Queries your Salesforce org for a record that matches what the user enters.

 Decides whether to update the matching record or create a new one.

 Creates or updates a record.

Create the Flow and Add a Screen

1. From Setup, enter Flows in the Quick Find box, then select Flows.

2. Click New Flow.

3. Make sure Start from Scratch is selected, and click Next.

4. Select Screen Flow and click Create.


5. On the flow canvas, on the path after the Start element, click .

6. Select Screen. The New Screen window opens.

7. For Label, enter Contact Info.


The API Name is automatically set to Contact_Info.
8. Click Done. The canvas now includes three items: Start, Contact Info, and End.

9. Click Save, and enter these values.

 Flow Label: New Contact

 Flow API Name: New_Contact

10. Click Save.

Create a Record Variable for the Contact

Because you plan to capture contact information from the user, let’s create a record variable to store
that contact record data in the flow.

1. Click to view the Toolbox.

2. In the Manager tab, click New Resource.

3. For Resource Type, select Variable.

4. For API Name, enter contact.


5. For Data Type, select Record.

6. For Object, enter Contact.

7. Click Done. In the toolbox, the Manager tab now contains a contact record variable resource.

8. Click Save.

Add a Name Input Component to the Screen

You need to create form fields for the user to enter contact information on the screen. Let’s start with an
input component that collects the contact’s name.

1. On the canvas, double-click the Contact Info screen. The Edit Screen window opens.

2. In the Components pane, enter Name in the search box.

3. Drag Name onto the screen canvas.

The properties pane now represents the Name input component.


4. In the properties pane, for API Name, enter contactName.

5. Scroll down and click Advanced. Make sure Manually assign variables is selected.

6. Complete these steps to take what the user enters in the First Name and Last Name fields and
store those values in the contact record variable.

a. For First Name, select contact then select FirstName.

b. For Last Name, select contact then select LastName.

7. Click Done.

8. Click Save.
Add a Picklist Input Component to the Screen

Now let’s add the picklist for the user to select the contact’s parent account.

1. On the canvas, double-click the Contact Info screen.

2. In the Screen Components pane, enter Picklist in the search box.

3. Drag Picklist onto the screen canvas just below the Name component.

The properties pane now represents the Picklist input component.


4. In the properties pane, enter these values.

 Label: Account

 API Name: Account

 Data Type: Text

5. In the Configure Choices section, for Choice, select New Choice Resource. Enter these values.

 Resource Type: Record Choice Set

 API Name: accounts

 Object: Account

 Condition Requirements: None—Get All Account Records

 Choice Label: Name

 Data Type: Text

 Choice Value: Id

 In the Store More Account Field Values section, enter these values to store the ID of the
user-selected account in the contact record variable.

 For Field, select Id.

 For Variable, select contact then select AccountId.

6. Click Done twice.

7. Click Save.

Add a Toggle Input Component to the Screen

Now let’s add the toggle for the user to specify whether (or not) to update an existing contact if one is
found.

1. On the canvas, double-click the Contact Info screen.


2. From the Screen Components pane, drag Toggle onto the screen canvas just below the Account
picklist component.

3. In the properties pane, enter these values.

 API Name: update_toggle

 Label: If this contact already exists, update the existing record.

 Active Label: Update existing

 Inactive Label: Create other contact

4. Click Done.

5. Click Save.

Close and Open the Flow

1. To exit Flow Builder, click the back arrow.

The All Flows list appears.

2. To reopen the flow in Flow Builder, find New Contact on the All Flows list, and click it.
Run the Flow to View the Screen

At this point, your flow can collect contact information from the user and store that information in flow
variables. Let’s see what the screen looks like to users who run the flow.

1. Above the canvas, click Run.

2. Enter any values, select any account from the list, and click Finish.

STEP 2 Check for a Matching Contact in Your Org


Use a Get Records Element to Find a Matching Contact

Add a Get Records element to your flow to query your org for any existing contact whose name matches
what the flow user enters.

1. After the Contact Info element, click .

2. Click Get Records.


3. In the New Get Records window, enter these values.

 Label: Find a Match

 API Name: Find_a_Match

 Object: Contact

4. In the Filter Contact Records section, for Condition Requirements, select All Conditions Are Met
(AND).

5. Enter this condition.

 Field: FirstName

 Operator: Equals

 Value: select contact then select FirstName

6. Click Add Condition, and enter this condition.

 Field: LastName

 Operator: Equals

 Value: select contact then select LastName

Your flow canvas should look like this.


7. Click Save.

STEP 3: Branch the Flow


Add a Decision Element to the Flow

Now that your flow checks for a matching contact record in your org, let’s branch the flow. The path the
flow takes depends on whether a matching contact is found, and whether the user chooses to update
the matching contact or create a new contact.

Add a Decision element to create two branches in the flow: one that creates a contact record, and one
that updates any existing record that’s found.

1. After the Find a Match element, click .

2. Click Decision.

3. In the New Decision window, enter these values.


 Label: Update or Create?

 API Name: Update_or_Create

4. In the Outcomes section, notice the two listed outcomes: New Outcome and Default Outcome.

5. Make sure that New Outcome is selected, and enter these values into the Outcome Details
section.

 Label: Update Existing

 API Name: Update_Existing

6. For Condition Requirements to Execute Outcome, select All Conditions Are Met (AND).

7. Click Add Condition and then enter these conditions.

 First condition:

 Resource: select the Contact Info screen, then select the If this contact already
exists, update the existing record component, then select Value

 Operator: Equals

 Value: select the True global constant

 Second condition:
 Resource: select Contact from Find a Match, then click in the blank space below

 Operator: Is Null

 Value: select the False global constant

8. In the list of outcomes in the sidebar, select Default Outcome.

9. In the Outcome Details section, for Label, enter Create New, then click in the blank space below.
Notice that the list of outcomes now displays the outcome labels that you entered.
10. Click Save.
STEP 4: Create or Update a Contact
Use a Create Records Element to Create a New Contact

Now that your flow has the logic to decide between two paths, let’s build those two paths. First, build
the path for the default Create New outcome, which contains only one element.

1. On the Create New path, click .

2. Click Create Records.

3. In the New Create Records window, enter these values.

 Label: Create Contact

 API Name: Create_Contact

 How to set record field values: From a Record Variable

 How Many Records to Create: One

 Record: select the contact record variable

Your flow canvas should look like this.

4. Click Save.
Now the flow can create a contact record when the Decision element executes and takes the Create New
outcome’s path.

Use an Assignment Element to Set the Contact ID in the Record Variable

Let’s build the path for the Update Existing outcome. First, you need to get the record ID of the existing
contact into the contact record variable.

1. On the Update Existing path, click .

2. Click Assignment.

3. In the New Assignment window, enter these values.

 Label: Set Contact ID

 API Name: Set_Contact_ID

 Variable: contact > Contact ID

 Operator: Equals
 Value: Contact from Find a Match > Contact ID

4. Click Save.

Use an Update Records Element to Update an Existing Contact

Now that the contact record variable contains the record ID of the matching contact, you can reference
that contact record variable in an Update Records element.

1. After the Set Contact ID element, click .

2. Click Update Records.

3. In the New Update Records window, enter these values.

 Label: Update Contact

 API Name: Update_Contact

 How to Find Records to Update and Set Their Values: Use the IDs and all field values
from a record or record collection
 Record or Record Collection: select the contact record variable

Your flow canvas should look like this.

4. Click Save.

You might also like