Creating the Lead Finder app using the Flow builder

In this section, we will follow step-by-step instructions to create a page that can help find leads from Salesforce using the email of the lead, and if the lead is not found, it takes the user to a screen where they can create a lead. The aim of this section is to learn how to use the Flow builder to build forms and to add logic.

You can search for Flows in the Classic or Lightning Experience setup: Setup | Process Automation | Flows. The final finished version of the Flow should resemble what is shown in the following screenshot:

  1. Create a Screen element with an input field to allow users to input their email. The screen element can be dragged from the palette to the canvas, as shown in the following screenshot. Add the input form field of thee text type. Let's take a look:
  1. Assign the input element bounded to the textbox to a private variable (this can be avoided; however, for demonstration purposes, we are showing you how you can store the values in the private variables). Notice that an input variable is automatically created once you add an input field. Refer to the following screenshot:
  1. Add a Fast Lookup element to search for the record from the database, and assign the result to an object private variable that we created. This is shown in the following screenshot:
  1. Add a decision element to branch into one when the lookup returns a record and another when the lookup has no result. Notice in the condition section that we used Resource as the FAST LOOKUP to see whether it evaluates to true:
  1. The display screen for the successful outcome is as follows:
  1. If no records are found, we display a new screen with the necessary fields. Create some new screen elements with fields, as follows:
  1. On record creation, we display the ID of the lead record. Also, note that we can handle faults when we run a Fast Lookup or Record Create, or any of the DML elements to show an exception or to handle exceptions:

Once you have completed the Flow, you can run the Flow in both Salesforce Classic and Lightning Experience.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.54.136