Hi folks, in this post I’m going to discuss about GET RECORDS element in Salesforce flows.
GET RECORD element is used to fetch record from the Salesforce org.
In this example we are going to create a Screen flow to learn about GET RECORDS element.
Screen flow appears as a screen and displayed with the help of lightning page or utility bar.
Once you drag the GET RECORD element from toolbox on the canvas you need to add details like Label, Description and object name.
Note – It is always a best practice to give your flow elements a description to add more clarity for the future users.
Under object label you need to Select the object from which you want to fetch the records.
Once you select the object you can filter the records to be fetched as per your scenario requirements.
While configuring the GET RECORD element you have a picklist with Sort Order label which allows you to select the order in which you want to fetch the records.
The records can be fetched either in ascending, descending or not sorted order. Sort By is the label where you can select the field on the basis of which the sorting should be performed.
We can store record data in flows using following three ways:
i). Automatically Store All Fields – After you select this, a variable will be generated automatically, and you will be able to reference all of the fields later in the flow.
ii). Choose Fields and Let Salesforce Do the Rest –The benefit of utilising this sort of approach to store data is that as the number of fields lowers, so does the system’s processing time. As a consequence, your flow execution will now be faster.
iii). Choose Fields and Assign Variables – To store record values manually in a screen flow or autolaunched flow, select “Choose fields and assign variables (advanced)”.
BUSINESS SCENARIO : User at SalesforceGeek wants to fetch the record from Account object with following conditions:
i). AnnualRevenue is Greater than 1000 AND
ii). Industry is Education OR Agriculture
For more details about GET RECORDS element and solution of the business scenario checkout the video