How to Pass the Entire Record to recordId in Salesforce Flow?

#1MinuteTip Do you know that you can pass the entire record to recordId resource/variable in Salesforce Flow? All you need to do is to define the data type of the resource as “Record”.

If you weren’t aware of this, then the chances are that you were using “Get Records” element to get the entire record. Well, now you don’t need to do that anymore and make your Flow more efficient.

“recordId” is a special resource in Salesforce Flows that automatically receives the value of the current record Id. For example, if you want to invoke the flow from an “Action” button on an object, there isn’t a way to pass any value to the Flow. In this case if you define a resource of “recordId” in the Flow and mark that as “Available for input”, Salesforce will automatically pass the record Id of the current record to this resource in the Flow.

And if you define this resource’s data type as a “Record”, the entire record will be passed to the variable. Here is an example.

1. Here is screen flow where I have defined the resource “recordId”. Note that the data type of the resource is “Record” and object is “Account”. The resource has been marked as “Available for input”

Resource recordId with data type as Record, object as Account. Check the box Available for Input

2. In this screen flow, I have defined a screen component of “Display Text”, that just shows the value of the different fields of the resource defined above. This is to validate that the entire record value is getting passed to the resource “recordId”

Display Text Component in Screen Flow showing value of recordId fields

3. Next, I have defined an “Action” on Account object and calling the screen flow from this action. As you can see, there is no option to pass any value to the screen flow from action.

Action defined on Account object calling screen flow

4. When I call the screen flow from the “Action” button from an Account record, Salesforce will automatically pass the current record to the “recordId” resource in the flow. This happens automatically behind the scenes. And now, I can see the value of the different fields of the “recordId” variable as defined in the screen flow.

Output showing the value of different fields of recordId resource

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Don't Miss Our Pre-Launch Offer on "Mastering Salesforce Flows"

27% Off + FREE Premium Membership

Expires In

:
:
: