#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”
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”
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.
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.