Adding the Record Create element to a Flow

The Record Create element allows you to create a record in Salesforce using the values from the Flow. This only creates a single record at a time. You can also use the SObject variable to create a single record with all field values. Now, we will add one Record Create element to this Flow:

  1. Navigate to the Palette tab and drag and drop the Record Create element onto the canvas; this will open a new window, where you have to enter the following details:
    • Name: Enter the name for the Record Create element. In this case, enter Create lead record as the name.
    • Unique Name: This will be autopopulated based on the name.
    • Description: Write some meaningful text so that another developer/administrator can easily understand why this Record Create element was created. When you select the Record Create element in the Explorer tab, the description appears in the Description pane.
    • Create: Select the object for which you want to create the record, in this case, the Lead object.
    • The next task is to assign the value or resource to the object fields, so the data types must match. To assign values to multiple fields, click on the Add Row link. Map the Company field with the screen input field {!Company}, the Email field with the screen input field {!Email_Address}, and the LastName field with the screen input field {!Last_Name}, as shown in the upcoming screenshot.
    • Variable: Optionally, you can save the new record's ID in a variable, so you can use it later in the Flow. Let's create a Text variable with the name VarTLeadID by expanding the CREATE NEW section of the drop-down list and setting Input/Output Type as Input and Output.                                                              

This will look like what is shown in the following screenshot:

  1. Once you are done, click on the OK button.
  2. Use a connector to connect to the Screen and Record Create elements and set the Screen element Create Leads as the Start element, as shown in the following screenshot:
  1. Save the Flow with the name Create Leads and click on the Run button to test the Flow. Enter the required data in all the fields;
  2. Once done, click on the Next button, as shown in the preceding screenshot, and Flow will create a lead record in Salesforce, as shown in the following screenshot:

Here, you learned how to create a record using Flow and how to test it. In the next section, you will learn how to add a child record to a parent record (lookup, master-detail, or junction object), for example, how to add a new contact to an account.

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

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