Hi folks, in this post I’m going to discuss how to update records using the UPDATE RECORD element in Salesforce flows.
Before we start with the topic, if you are new to Salesforce and want to know more about Salesforce flows and flow builders you can check out What is Salesforce Flow Builder and basic Building Blocks of Flow Builder
In this example, we are going to use a Screen flow to update records.
Drag the Screen element to the canvas which will present the user with a screen to select a record to update.
The screen element is used to collect information from the user and is only available in a screen flow.
We will use this screen to capture the already populated values of a record
As you can see above, using the screen element we are creating an Account record having an Account Name field.
Now to update the record we will drag the UPDATE RECORD element to the canvas.
Want to Learn Salesforce Flows? Checkout our Salesforce Flow Course
We have two ways to find the records to update :
1. Use the IDs and all field values from a record or record collection
- It is similar to the way we update any record using the Salesforce UI and then saves the changes
2. Specify conditions to identify records, and set fields individually
- Here you can filter records to be updated based on a specific condition
Method 2 is generally used when you need to update the same field value for a collection of records.
As we have individual fields to update on the record, we will use method 2
Filter records based on record Id. Create a new resource in order to fetch the Account object records.
Always remember to check the “available for input” checkbox to capture data from the records detail page.
Select the fields to update in the record.
Add the screen flow to the detail page of Account records.
Learn Salesforce with free video tutorials
BUSINESS SCENARIO: The user at SalesforceGeek wants to update the following fields on Account object records
i). Account Name
ii). Account Description
iii). Number of Employees
For more details about the UPDATE RECORDS element check out the video