How to pass your current RecordID in your screen flow
How to do it from a Lightning Page or a Quick Action
Overview
For every automation you build using Flow Builder, you must modify and update records at some point. Creating a record ID variable in Flow Builder allows you to reference, manipulate, and transfer specific Salesforce records between flow elements, streamlining your flow's functionality and navigation.
Here is a quick walkthrough about how to pass your current RecordID in your screen flow.
Steps
For App Builder
The steps to pass the RecordID are as follows:
1. Create the flow Variable
First, you must create a flow variable to store the RecordID value. Make sure to make the flow variable is available for input
.
Open the Flow Builder Toolbox
Click on the "
New Resource
" buttonSelect "
Variable
" as a resource typeEnter an API Name
Select the appropriate object to which you'd like to pass this RecordID to.
Check the "
Available for Input
" checkboxClick "Done"
2. Check the RecordID option from the app builder page
Drag and drop the Flow element on the app builder page and select the relevant flow to be displayed.
Select “
Pass all field values from the record into this flow variable
” to send all the field values into the created variable.
Problems?
If you don't see the RecordID checkbox in App Builder, please make sure to complete Step 1 first.
For Quick Actions
To pass a record ID to a Flow in a Quick Action, follow these detailed steps:
Create the record ID variable
Create a record ID variable in the Flow:
Open your Flow in Flow Builder.
Click the "Manager" tab on the left panel.
Click "New Resource" and select "Variable."
Enter a name (e.g., "recordId") and set the Data Type to "Text."
Check the "Available for Input" checkbox to make it an input variable.
Click "Done."
![](https://flow.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FeMWTVSXKOu4VzhzH49wv%252F2021-01-19_09-28-38.webp%3Falt%3Dmedia%26token%3D93b7e9ad-bc88-4a49-8957-f93986c3b10c&width=768&dpr=4&quality=100&sign=3668c436&sv=1)
Create a Get Records collection
I use the recordId variable in my Get Records element to search for specific records associated with the object I started from.
![](https://flow.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FWid8kSkAuOzcJQ3RxPe6%252F2023-04-19_21-19-12.png%3Falt%3Dmedia%26token%3D702eec21-47e2-4ad4-8302-3f442927eeed&width=768&dpr=4&quality=100&sign=b60b44bf&sv=1)
You're done!
Last updated