top of page
Blog
Writer's pictureIryna Yamborska

A step-by-step Guide on How to create a Screen Flow in Salesforce

Salesforce Flow enables users to build complex business solutions using clicks, not code. In this article, we'll discuss what Salesforce Flow is, how flows simplify business processes, focus on the Screen component, and also provide you with a guide on how to create a Screen Flow in Salesforce.


What is Salesforce Flow?


Flow is the most powerful automation tool provided by Salesforce for automating everything from sending emails and custom notifications to using triggers that create, update, or delete records in Salesforce.


There are the following types of Flow:

 What is Salesforce Flow | Sparkybit Blog

  • Screen Flow:\ With Screen Flow, you can create your own interactive UI and guide the user through the desired business process, which you can run from Lightning Pages, Experience Cloud, and more.

  • Scheduled-Trigger Flow:\ Such a Flow is activated at a specified time and with a planned frequency. It is an excellent alternative to Apex batch jobs that developers use for similar tasks.

  • Record Triggered Flow: \ This Flow is activated when a Salesforce record is created, updated, or deleted. Previously, Apex triggers for these automations were used, but now some of them can be performed with Flow.

  • Platform Event Flow:\ It is activated when receiving a Platform Event message. For example, we can load data from a third-party service and then use Flow to separate it and create records in different Salesforce objects.

  • Auto-launched Flow:\ Runs from Apex, Process Builder or REST API.


Interaction components of Salesforce Flow


Interaction components of Salesforce Flow | Sparkybit Blog

Salesforce provides a large selection of different components, which are a set of various actions that you can use to perform various kinds of operations.

  • Screen component allows the creation of a UI that guides the user through the business process;

  • Action component pauses the Flow until the specified Aura Enabled component is executed;

  • Subflow component launches another Flow while the current one is executing.

The components of Salesforce Flows take a closer look at next.



Logical components of Salesforce Flow


Logical components of Salesforce Flow | Sparkybit Blog

Salesforce Flow allows performing Logical operations on data, such as:

  • Assignment is used to set values ​​to variables, collection variables, record variables, record collection variables, and global variables;

  • Decision is a flow element that allows you to evaluate a set of conditions and guide users through the Flow based on the results of those conditions;

  • Loop is a Salesforce Flow element that is used to loop through multiple items in a variable collection;

  • Collection sort component is used to sort a collection's items in ascending or descending order and optionally reduce the amount of items in that collection to the given number.

Data (SFDC) components of Salesforce Flow


Data (SFDC) components of Salesforce Flow | Sparkybit Blog

Data (SFDC) components are used to interact with the database and perform CRUD operations on records:

  • Get Record. With this element, you can easily find Salesforce records that match the filter conditions and store their values ​​in variables.

  • Create Record. Allows you to create as many Salesforce records as you want using variables or other values ​​from the Flow.

  • Update Record. Identify the Salesforce records you want to update and set the values ​​you want to change in those records. To do this, use identifiers and field values ​​stored in a record variable or record collection variable, or use special conventions to identify records and set field values ​​separately.

  • Delete Record. With this component, you can delete specific Salesforce records by using identifiers stored in a record variable or record collection variable or by specifying conditions.


How to create a Screen Flow in Salesforce? The Step By Step Guide with screenshots


Screen Flow is a type of Flow that allows us to interact with the user through a UI where they can either enter some data or select entries. This Flow provides the user with instructions and input fields, and after filling, performs defined actions such as: creating, updating records, etc. The users will navigate through a series of screens we've created without writing a single line of code. Let's imagine that we need to give the user the opportunity, being on the company page, to add new workers to this company, while filling in all the necessary fields. Screen Flow can help us with this task. Let's try to create such a flow together.


1. First, create a new Flow and select the appropriate type (Screen Flow).

Screen flow in Salesforce instruction | Sparkybit blog

2. Then add a new Screen component.

Screen flow in Salesforce | Sparkybit blog

3. A pop-up with the component settings will appear on the screen. Enter the title for this component in the “Label” field, and the “API Name” field will be filled automatically.

Salesforce screen flow api | Sparkybit Blog

4. There is an opportunity to remove unnecessary buttons and rename the “Finish” button in the “Configure Footer” section.

how to create a Screen Flow in Salesforce

5. Now we need to add some necessary fields. To do this, find the appropriate type of component in the left section and drag it. After that, in the “Label” field on the right, enter a name for each field and click “Done”.

Salesforce screen flow label field | Sparkybit Blog

6. Now when we are done with the screen component, we need to save all the data entered in the screen component to the database. For that, we need to add the "Create Record" element after the Screen component.

Salesforce flows "Create Record" screen component. | Sparkybit

7. Next, we need to name our new component and do some tune-ups. For that, in the "How to Set the Record Fields" section, select the "Use separate resources and literal values" option. We will be creating a Contact object record, so we select it below.

Salesforce screen flow Use separate resources and literal values | Sparkybit Blog

8. Now we need to map the fields from the Screen component to our Contact record. At the very bottom of the window, in the “Set Field Values for the Contact” section, there are two sections: “Field” and “Value”. The “Field” section contains all the fields of the Contact object, and the “Value” section contains all the values that are available in our Screen Flow. So, let's select the necessary fields on the Contact object and the corresponding ones from our Screen component.


Salesforce Screen Flow Set Field Values for the Contact | Sparkybit Blog

9. But that's not all: we still need to make sure that the newly created Contact record is linked to our Account record. To do this, we need to add another field that will accept the Account Id, and the value of this field will be the global variable Flow → CurrentRecord.

How to creare Salesforce screen flow | Sparlybit Blog

10. Click the "Done" button, and then click the "Save" button in the upper right corner to save our Screen Flow. In the Flow Label field, enter a name for our flow and click “Save” again.

how to create a Screen Flow in Salesforce screenshots

11. And don't forget to activate your flow, otherwise you won't see it in the list of available components on the page layout.

Salesforce screen flow page layout | Sparkybit Blog

12. Now add our flow to the Account page and that's it.

Add flow to the Account page | Sparkybit Blog

13. The component is added and it works.

How to make screen flow in Salesforce | Sparkybit Blog

 

Salesforce Flow is a very powerful and useful declarative development tool that enables you to do useful things without writing a single line of code. Today we learned about what Flow is, about the main elements of Flow, and we looked at the Screen Flow type as an example in more detail.

If you still have questions about Screen Flow setting up, or questions about other types of Flow, contact us, and we’ll help you to deal with that.





Comments


Commenting has been turned off.
bottom of page