Kishore
Kishore I am a Salesforce developer and a so-called blogger at SalesforceLwc.in. I love learning and sharing.

Update Record using Flow Builder in Salesforce

Update Record using Flow Builder in Salesforce

To create or update records in Salesforce you no longer need to write a Lightning component, you can make use of Lightning Flow Builder where you can create any requirement just by clicks. Mastering flows can reduce the usage of code by 70-80%, and you don't have to write any test classes for what you build. Flows come with a component visibility option with which you can show/hide flow components conditionally.

Let’s create a flow to update and view a Contact record

Main lightning flow builder flow

Preview

Flow Elements Required

  • Get Records Element
  • Screen Element
  • Update Records Element

Flow Variables Required

  • recordId (Text)
  • accountLookupId (Text)
  • varContactRecordValues (Record)

recordId (Text) record Id flow builder

accountLookupId (Text) account lookup Id flow builder

varContactRecordValues (Record) contact record flow builder

All Resources Used

All Resources Used flow builder

Get Records Element

Get Records Element is used to find and get the records from the Salesforce database. In this case, we will use Get Records Element to get the record using record Id, for this, we need to create a variable named “recordId” and allow it for input and use this record Id to filter the contacts and get the contact record.

Get Records Element in Lightning flow builder

Screen Element

There are a lot of screen components available. In this case drag and drop Name (for “First Name and Last Name”) and Lookup (lookup tp Account) components with configuration mentioned in the below images.

Screen Component Lghtning flow Builder

Name Element Name Screen Element in Lightning flow builder

Lookup Element Lookup Screen Element in Lightning flow builder

Update Records Element

Filter the contact you want to update using record Id variable and set Field values for the Contact Records with field mapping.

Lookup Screen Element in Lightning flow builder

Add Flow Component to Record Page

Drag and drop Lightning flow to the record page with following configuration.

Add Flow Component to Record Page in Lightning flow builder

Live Flow Component

Enjoy the live easy made flow component to edit and view contact record.

Live Flow Component Record Page in Lightning flow builder

Write to me how you feel about new Lightning Flow Builder and how it made your life easier.