How can I pass record ID to flow? - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Cris AbadCris Abad 

How can I pass record ID to flow?

Hello everyone,

I am running a flow from one custom object (flow is in a quick action, since lightning doesn't support buttons) which creates a record in another custom object. My question is, how can I pull the record ID from the record the flow is being ran from and store it into the new record?
Best Answer chosen by Cris Abad
Deepak AnandDeepak Anand
All you have to do is to create a Variable like as below - 
  1. Type: Variable
  2. Name: recordId [Create Exactly Like This]
  3. Input/Output Type: Input Only
User-added image

Then when embedded as Lightning Component, Salesforce will automatically send the record Id into this variable. Don't forget to create it exactly as shown in the figure.
User-added image

All Answers

Deepak AnandDeepak Anand
All you have to do is to create a Variable like as below - 
  1. Type: Variable
  2. Name: recordId [Create Exactly Like This]
  3. Input/Output Type: Input Only
User-added image

Then when embedded as Lightning Component, Salesforce will automatically send the record Id into this variable. Don't forget to create it exactly as shown in the figure.
User-added image
This was selected as the best answer
Cris AbadCris Abad
Thank you!
Xavier Poirier-MoisanXavier Poirier-Moisan
Hi Deepak,

Is it possible to do the same but triggering the flow from a quick action button?

I see from this answer that the link between the flow is the variable and the flow component. How can you do the link between the flow variable and a quick action button?

Thanks
Connor CaseyConnor Casey
@Deepak I have the same question as Xavier. I'm trying to start a flow via a Quick Action button on the standard Account object that will create a related Case. I have the flow start with a Decision Rule that determines if the Account is "live" or not. However, it only seems to send people to the default outcome of the Decision rule, even when the alternate choices are "true". 

Any help would be much appreciated! I just need to pass the standard Account ID to decision element of the flow, and also to the Account ID on the Case object that will be created at the end of the flow. 
Megan MoodyMegan Moody
I also have the same question. I need to launch it from a quick action rather than a Lightning flow component for reasons I won't go into. However, I don't know how to pass in the ID from the current record it's being opened from. 
Connor CaseyConnor Casey
@Megan I asked the question in a new thread yesterday and got an answer: https://success.salesforce.com/answers?id=9063A000000t4EP
Megan MoodyMegan Moody
@connor - Thank you! That saved me so much time. 
Edgar SampsonEdgar Sampson
Does anyone know.. are there any other variables like this for flows, or is this the only one? Can't find any documentation on it.
Leonard WagnerLeonard Wagner
Hi everyone,
I try to make an Flow referenced by a recommendation (released Q1 2019 in Next Best Actions). This flow needs the recordId from the record the recommendation was accepted. Can anyone help me to pass the recordId through the flow?
Thanks
Thomas BenigniThomas Benigni
Thank You 
Sudhansu Sekhar DashSudhansu Sekhar Dash
Hi Deepak Anand 
I am not seeing the "recordId" in the app builder.
I have created the variable as you said, but is there any step i missing to show in the record detail page.
Ben SmithBen Smith
Why in the heck is this variable not pre created or have an option when creating a new flow to have it created..  UGH..  And it is case sensitive; I did RecordID and it didn't work.  Must be "recordId"   Cap I.
Yaakov SingerYaakov Singer
We built multiple flows that are called by buttons on an object detail page, and they successfully receive the recordId and process.  However, when we click on the button and call the flow from the Partner Community - even as a System Administrator, the flow errors and the flow interview shows that the recordId is null.
Has anybody else experienced this?  It is almost certainly not an issue of permissions.  The sysadmin runs the flow internally and the recordId is passed.  The sysadmin runs the flow through the community and the recordId is not passed.  Ideas?  Thx
Tony DeGregorioTony DeGregorio
I'm having the same issue as Yaakov - flow does not work when fired from Community - recordId is null.  Anyone have any ideas?
Alan Tellez ServinAlan Tellez Servin
Yeah, same problem as Yakov, the button works as intended in lightning but in the community doesn't.
T WymanT Wyman
Has anyone found a solution for this?  I am running into the same problem.