A client had requirements that they want to enter leads on a mobile device when they visit a conference. Since she meets several people in the event, she needs a simple form with only a few fields. In this article, we explain how such a requirement can be implemented using lightning flows.
Automation, or the practice of having software and machines perform routine tasks is taking over and is here to stay in almost every industry around us. Salesforce Flows are precisely that. It is an automation tool that provides declarative process automation for the Salesforce app, experience, and portal. Salesforce gives us the functionality through Flow Builder to fully automate a guided visual experience. It has very high functionality as it can be implemented in almost all processes to bring some form of automation.
This flow is particularly helpful for businesses or salespersons who need to be able to enter leads on the go. Say, at a Sales Expo of sorts, The salespeople there need to be able to provide essential information for leads fast on mobile devices. This is where the Flow comes in. This flow will be added to the mobile app layout so that crucial information can be entered for new leads by removing the hassle of filling out every field of a Lead in fast-paced situations. The flow is used to take important Lead information, such as the First Name, Last Name, Email, Mobile, and Company name. The Last Name field is a required field for any Lead to be saved. The Company field is here to identify the Company the lead is for and the Phone and Email fields to communicate further with the Lead. We set these as input parameters and transpose the data into lead records when the user clicks finish.
Here, we will be creating a one-screen flow where the first screen would be responsible for getting the required input variables from the user such as the First Name, Last Name, Company, Email, and Phone No. Then we will have a create records Element which will enter the details received by the user into Lead records. The flow will require one-screen elements, five input fields, and Create records screen element for execution So here is a step-by-step guide of how we Create Leads using Mobile devices using flows!
- First, we select Screen-based flow with an auto-layout scheme.
We start by adding one screen element on the flow and connecting the Start to the screen element. In this element, we need to add five input components: Last Name, First Name, Email, Phone, and Company. All will be text type apart from the Phone and Email which will be their own types respectively.
- We then drag and drop a Create Records element on the Screen which will be based on the object Leads to create records from the flow based on the Input parameters. As at any point, only one lead can be entered. We select the create one record with literal values checkboxes.
Now, all we have to do is connect the Elements on the screen from the Start to the Screen element to Create. Save and activate the flow!
This creates the first part of the problem as we have created a Lead to get essential data. Now we need to assign the flow over on the layout of the Mobile devices.
- Firstly, go to the Leads record page and select the Edit page option.
- Then, as we need this layout on the mobile page, we select the Mobile layout option.
- From there, we drag and drop the flow component onto the screen and select the flow required.
- Then we set it as Org default so the page can be seen and used by all users and we save and activate the Page.
This would lead to us having a Mobile Lead record page layout where leads can be easily added with just the basic information to save time.
Screen-based flows are extremely useful in automating processes where Screens are needed to take inputs from the user and display the required information. It allows us to integrate various systems into one user-friendly interface. The main benefit is that it gives users the ability to configure process logic and be in full control of the design of the end-user experience without extensive knowledge of Apex and programming principles.