function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jordan VasquezJordan Vasquez 

Cannot pass values to Lightning Component in Flow.

Hello,

I am having issues with my Lightning Component in Flow. I for some reason can't pass any data from my Flow to my Lightning Component. I can absolutely grab the data from my Lightning Component and use that.

Basically all my flow does is compose an email based on information from the record that it is pointing at. Before the email is sent, it shows the Subject and Body of the email and allows someone to edit the information prior to sending the email. I cannot get the Lightning Component to work in my flow if I am inputting values from my flow into my component, it just fails to load. 

Any suggestions on how to get around this? I want to avoid building something custom but I might have to.

No inputs into Lightning Component via Flow:
Component Showing / No Input into Lightning Component in Flow


Input for Lightning Component via Flow, component no longer visible:
Component Not Showing / Have value input into Lightning Component

Input for those curious:
Simple Input into Body Attribute on Lightning component

Component Code:
<aura:component implements="lightning:availableForFlowScreens" access="global">
    <aura:attribute name="subject" type="String" access="global" />
    <aura:attribute name="body" type="String" access="global" />
    <div id="subject-editor">
        <lightning:input value="{!v.subject}" /> 
    </div><br/>
    <div id="body-editor">
        <lightning:inputRichText value="{!v.body}" /> 
    </div>
</aura:component>

Component Design Code:
<design:component>
    <design:attribute name="subject" label="Subject" />
    <design:attribute name="body" label="Body" />
</design:component>

 
Best Answer chosen by Jordan Vasquez
Alain CabonAlain Cabon
Hi Jordan,

I reproduced your problem and the reason is just the name body which is a reserved word for the ligthning components and must not be used here.

Just replace body with body1
 
<aura:component implements="lightning:availableForFlowScreens" access="global">
    <aura:attribute name="subject" type="String" access="global" />
    <aura:attribute name="body1" type="String" access="global" />
    <div id="subject-editor">
        <lightning:input value="{!v.subject}" /> 
    </div><br/>
    <div id="body-editor">
        <lightning:inputRichText value="{!v.body1}" /> 
    </div>
</aura:component>
 
<design:component>
    <design:attribute name="subject" label="Subject" />
    <design:attribute name="body1" label="Body" />
</design:component>

Otherwise, you made disappear the component in your flow.

All Answers

Alain CabonAlain Cabon
Hi Jordan,

I reproduced your problem and the reason is just the name body which is a reserved word for the ligthning components and must not be used here.

Just replace body with body1
 
<aura:component implements="lightning:availableForFlowScreens" access="global">
    <aura:attribute name="subject" type="String" access="global" />
    <aura:attribute name="body1" type="String" access="global" />
    <div id="subject-editor">
        <lightning:input value="{!v.subject}" /> 
    </div><br/>
    <div id="body-editor">
        <lightning:inputRichText value="{!v.body1}" /> 
    </div>
</aura:component>
 
<design:component>
    <design:attribute name="subject" label="Subject" />
    <design:attribute name="body1" label="Body" />
</design:component>

Otherwise, you made disappear the component in your flow.
This was selected as the best answer
Jordan VasquezJordan Vasquez
UGH! Such a silly mistake, thanks for the help that was exactly it!