You need to sign in to do that
Don't have an account?
salesforce coder
How to pass recordId from Quick Action to flows
On the Opportunity record I have a quick action to create Contact roles. When I click on the quick action , I am opening a flow screen. And on that screen I need to prepopulate the Opportunity Id from where I came . What is the way ?
I created a variable called recordID and set the type as input. Foe some reason that is not working. Any help ??
I created a variable called recordID and set the type as input. Foe some reason that is not working. Any help ??
You can set that using design attributes on the component you are embedding in the flow, say if you create an attribute to take the recordId and give design attribute for it Then on your flow screen in the 'Field Settings' tab bind the "Opp Field Value" to the variable you have created "{!recordId}"
If in your inputField if your value is bound with {!v.oppFieldValue} then you should be able to get the Opp Id in it.
Please let me know if you have any issues
Thanks,
Ashwin
I, too, am having an issue with this. I have a Screen Flow that I want to execute from a Quick Action on the Case object. While I have an "Input Only" variable on the Screen Flow for the Case ID, there is no place to pass in system-generated inputs to the Quick Action setup, so the record ID is never received and used by the flow.
The flow has system/global variables in it and one of the options is called {!$Flow.CurrentRecord} -- attempting to extend any properties off this "CurrentRecord" object to treat it like a SObject most definitely throws JS errors on the front-end when attempting to launch the flow.
If you want to send the recordId to the flow action from the case object please create an attribute named "recordId" (case sensitive) with input only or input and output as option. The recordId gets automatically set based on which object the flow action is called from https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_guide.meta/salesforce_vpm_guide/vpm_distribute_internal_action.htm please refer this.
If your flow is used in the app builder page the recordId can be set via the design attribute on the app builder please refer this https://success.salesforce.com/answers?id=9063A000000id3jQAA
Please let me know if you have any issues.
Thanks,
Ashwin
I believe this is also what the original requester needed. The input flow variable `recordId` is case sensitive -- the original poster listed the varaible name as `recordID`
I'm having issues getting this to work, hoping someone can give guidance. I've created my variable and made it case sensitve recordId. Based on Salesforce guidance I don't even need to make a "Get Records" (or "record lookup" in classic) per this article https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_guide.meta/salesforce_vpm_guide/vpm_distribute_internal_action.htm
When I get to my record creation I have a master-detail lookup field I need to populate to tell the system hey, this new record we're creating is a child of the record we executed the action on, but when I get to the end of my flow I keep getting an error and in the report it says the required field (the master-details field) is missing. I've verified that my variable is case sensitive and I've verified that the record creation has a line to update the master-detail field with the recordId variable.
I also tried making a "Get record" element as the first step. I made the criteria id = recordId and didn't assign any fields as a resource, still didn't work. Then went back and in the "Get Record" element I assigned the "ID" as a resource called MasterRecordId and then updated my record creation screen to update the master-detail with this new MasterRecordID variable but that isn't working either. Not sure what I'm missing but any guidance is appreciated.
I've opened a case with Salesforce and will update here if I get a solution to this. However, I thought I'd also see if anyone has more information on this since the last post?
At the beginning of my flow I ran a GetRecord where the ID matched my text variable labeled "recordId" (case sensitive). Per this article (https://help.salesforce.com/articleView?id=flow_actions_considerations.htm&type=5), that is correct way to pass the variable from the Quick Action into the Flow. The GetRecord may not have been necessary but I wanted to use variables from that record for other areas of the screen flow.
Below is my GetRecord Element screen
Hopefully that helped sort it out!