Check out my previous articles:
- Want to be an Early Adopter of the New Lightning Flow Builder? Welcome Aboard!
- Getting Started with Lightning Flow Designer– Part 1 (Creating a Variable)
In the aforementioned articles, I have discussed the new Lightning Flow designer tool – introduced by Salesforce in Spring’19 release and some basics concepts of Flow – to help you better understand the elements of a flow designer. If you didn’t get a chance to read it yet, do it now! It will significantly improve your knowledge of Lightning Flow. Once you master the art of leveraging Lightning Flow, you will be able to easily create an optimized flow!
In this article, we will discuss the following topics:
- What is a Screen Element?
- What is the purpose of a Screen Element?
- How to create a Screen Element?
- Explore different ways to call Flow with Screen Element.
What is a Screen element?
A Screen Element bestows power on Lightning Flow by making it more robust compared to the Lightning Process Builder. You might be thinking how and why? Let’s see through a business use case.
Business Use Case
Edward Backhouse is working as System administrator at GurukulOnCloud. Edward received the following requirement from his manager – create a lead capture form which looks like the following screenshot:
Later Edward has to put this form on the Home Page Layout and open it for the entire world.
A solution for the above business requirement
If you are a Salesforce Developer, who knows how to create a Lightning Component, fulfilling the above requirement would be a piece of cake for you. But if you don’t have development experience, it might be a nightmare for you. Even though you may know how to write code in Salesforce, it is best practice to first try and see if you can conjure up a declarative solution.
Here, we can use Lightning Flow and Screen Element to solve the above business requirement. Let us start by understanding the role of a Screen Element. A Screen Element allows you to take users’ input and process it – yes, one can write custom logic to process user entered data. That’s the power of Lightning Flow – as oppose to Lightning Process Builder that doesn’t have the capability to take user input and process it.
I hope now you understand the power of Screen Element. Let’s take the discussion further and understand how you can create a screen with few fields in Lightning Flow. Perform the following steps to create the solution using the new Lightning Flow Designer:
- Log-in into your developer org.
- Navigate to Setup (Gear Icon) | Setup | Process Automation | Flows.
- You’re now in the Flow management page. Based on your current org setting, you may see the following buttons:
- New Flow – Use this button to create a Flow in the new Lightning Flow Designer.
- New Flow in Cloud Flow Designer – Use this button to create a Flow in the classic (old) Cloud Flow Designer.
- Now click on the New Flow button; it will open the Flow canvas for you.
- Next, we will use the Screen element to create a lead capture form. Drag and drop a Screen element onto the canvas. And then, follow the steps as shown in the video:
- Now if you want to add colorful flavor to your Flow then, watch the following video (this is a hidden gem and Lightning Flow doesn’t support!!!):
- The next step is – add two Text fields (Last Name and Company) to Screen Element. Then, drag and drop the field onto screen element – Check out the video for step-by-step instructions and some tips:
- Now we will add one Lightning Component field – which allows users to enter an email address. Check out the video for step-by-step instructions and some tips:
- Once you’re done, Save the flow and name it Lead Form v1, with Type: Screen Flow. Do not forget to activate the Flow by clicking on the Activate button.
- Woohooo, you have just created a Flow using Lightning Flow Builder.
Different ways to call Flow which contains Screen element
There are at least twenty ways (that I know) to call a Flow. When you use Screen Element (which is a Screen Flow), you still have tons of options. A Screen Flow can be launched using one of the following ways:
- Using Flow Component in Lightning Record Page
- Using Flow Component in Lightning App Page
- Using Flow Component in Lightning Home Page
- Using Flow Component in Lightning for Outlook
- Using a Custom Button
- Using a Custom Link
- Embed a Flow in Visualforce Page
- Using Login Flow
- Using Inline Visualforce Page
- Using Quick Action
I have added a link for each of the options – so that you can explore and learn more. Happy learning!!!!
Proofreader: - Munira Majmundar