🚀 Introduction
In Salesforce, automating processes through Flows has become a common best practice. But one frequently asked question by developers and admins is:
“How can I pass the current record Id to a Flow when it’s launched via a Quick Action?”
This is especially useful when you want the flow to act on the record it was triggered from — like creating related records, updating fields, or launching a screen flow with pre-filled data.
🧠 Prerequisites
- You have a Screen Flow created.
- You have API access to modify object settings and flows.
- You’re familiar with creating Quick Actions.
🛠️ Step-by-Step Guide
✅ Step 1: Create or Edit a Flow
- Go to Setup → Flows.
- Click New Flow, choose Screen Flow.
- Add a Text Variable called
recordId
(important: case-sensitive).- Variable Name:
recordId
- Data Type: Text
- Check “Available for input”
- Variable Name:
- Design your flow using this variable — e.g., get record details, show conditional screens, etc.
- Save and Activate your Flow.
✅ Step 2: Create a Quick Action
- Go to Object Manager → [Your Object] (e.g., Account, Opportunity).
- Go to Buttons, Links, and Actions.
- Click New Action:
- Action Type: Flow
- Flow: Select your Screen Flow
- Label: e.g., "Launch Custom Flow"
- Save the Quick Action.
✅ Step 3: Add the Action to Page Layout
- Still in Object Manager, go to Page Layouts.
- Open the layout where you want to show the action.
- Drag your new action into the Salesforce Mobile and Lightning Experience Actions section.
- Save the layout.
🔐 Step 4: Enable the Record Id Pass (The Secret Sauce 🧂)
Make sure the recordId
variable in the flow is:
- Named exactly
recordId
- Marked as Available for input
Salesforce will automatically pass the record Id of the current record to the flow when it’s launched via a Quick Action.
💡 Bonus Tip: Debugging
- Double-check the variable spelling and case.
- Ensure the variable is set to "Available for Input".
- Ensure the action is properly linked to the Flow and deployed on the record page.
🎯 Use Cases
- Launch a flow to create related records from a parent record.
- Auto-populate fields in a form using current record details.
- Start an approval or fulfillment process specific to the record.
🏁 Conclusion
Passing a record Id to a Flow via Quick Action is a simple yet powerful way to supercharge your automation. By setting up a single input variable and using Quick Actions, you can create tailored, contextual user experiences right from the record page.
Start building smarter, faster, and more efficient flows in Salesforce today!
0 Comments
Post a Comment