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
Nouredine LACHKARNouredine LACHKAR
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.