May 27, 2020

How to pass record Id in Flow to Lightning Component in Salesforce?

Aura Component Code:
<aura:component implements="lightning:availableForFlowScreens">    
    <aura:attribute name="RecordId" type="String"/>    
    <lightning:recordViewForm recordId="{! v.RecordId }" objectApiName="Account">
        <div class="slds-box">
            <lightning:outputField fieldName="Name" />
            <lightning:outputField fieldName="Industry" />
<design:attribute name="RecordId" label="Record Id" required="true"/>


Input Variable for capturing record id:

Pass RecordId which is the Input Variable:



  1. Hello,

    I am trying to pass a record id from the flow to lightning component (which is added to the flow) but I don't see an option to pass the record id. I added to the lightning component.

    In your screenshot above I see you have the "Record Id" in the sample flow but I don't get that option. Please help.

  2. I had the same problem and was able to figure it out with some help. You need to include the record id in the ".design" file as a design:attribute to make it available on the flow.

  3. Same, I added this to the .Design, the it worked just fine.