In Salesforce flows, accessing the current record’s ID is often essential, especially for updating, deleting, or fetching related records.
In this Salesforce tutorial, we will learn how to get the current Record ID in Salesforce Flows. Specifically, the screen flows.
Get Current Record ID in Salesforce Screen Flow
To obtain a current record ID in Salesforce Screen flow, we must first create a flow. To do this, navigate to Salesforce Lightning’s setup page and follow the steps below.
- In the Flows setup, click on the New Flow button. In the next window, select the option Screen flow and click on the Next button.

- To fetch the Record ID of the current record, we will create a variable. To do this, click on the toggle bar and select the New Resource button.

- In the new resource, enter the following fields.
- Select the Resource Type as a Variable.
- Enter the API Name as recordId and select the Data Type as Text.
- Finally, select the checkbox ‘Available for input’ and click the ‘Done’ button.
When we create a variable, such as recordId, which is available for input, the flow automatically takes the current record ID into the flow.

- Now, we need to pair the screen flow with a record; for that, add the Get record element to the flow. In this example, we will fetch the account records.
Enter the Label of the get record element, then select the object whose records you have to fetch. In the condition requirements, map the object ID to the record variable recordid.

- To display the current record ID, add a screen element to the flow.
- Enter the label for the screen element and add the display text component to the screen region. Enter the API name for the display text, then to fetch and display the record ID, click on the Insert a resource and select the recordId variable.
- I have also added the resource {!Get_Accounts.Name} to display the account name. After this, click on the Done button.

- Save and Activate the Screen flow.

Create Action to Call the Screen flow.
Now, we will call the flow with the help of an action, or you can deploy the flow from the Lightning App Builder.
- Navigate to the object tab, click the settings icon, and select Edit Object.
- In the object setup, click on the Button, Links, and Actions. Then, click on the New Action button.

- In the new action, select ‘Flow‘ as the Action Type. Then, in the Flow field, select the flow we created to get the record ID. After this, enter the Label and click the Save button.

- Now, go to the object Page Layouts, then in the next window, click on the Mobile & Lightning Actions.
- Drag and drop the new action into the Salesforce Mobile and Lightning Experience section, then click the Save button.

- On the object record page, click the Actions dropdown ( if not visible) and select the created quick action to display the record ID.

When you click on the quick action, it will call the screen flow and display the ID and name of the current record.

This way, we can retrieve the current record ID in the Salesforce screen flow by following the above steps.
Conclusion
By following the above steps, you will be able to retrieve and refer to the record ID of the current object records in the Salesforce screen flow, allowing you to manage your flows more efficiently.
You may also like to read.
- Pause and Resume a Screen Flow in Salesforce
- Use the Repeater Component in Salesforce Screen flow
- Display Image in Salesforce Screen Flow
- Use Record Choice Set in Salesforce Screen Flow
- Get 18 Digit Salesforce Id in Report
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.