Newer Version Available

This content describes an older version of this product. View Latest

Configure Components for Flow Screens

Make your custom Lightning components available to flow screens in the Cloud Flow Designer by implementing the lightning:availableForFlowScreens interface. In the Cloud Flow Designer, flow screen components appear as options for Lightning component screen fields.

Here’s the sample code for a simple “Hello World” component.

1<aura:component implements="lightning:availableForFlowScreens" access="global">
2    <aura:attribute name="greeting" type="String" access="global" />
3    <aura:attribute name="subject" type="String" access="global" />
4
5    <div style="box">
6      <span class="greeting">{!v.greeting}</span>, {!v.subject}!
7    </div>
8</aura:component>

Mark your resources with access="global" to make it usable outside of your own org, such as to make a component usable by a flow admin in another org.

Note

To make an attribute’s value customizable in the Cloud Flow Designer, add it to the component's design resource. That way, flow admins can pass values between that attribute and the flow when they configure the Local Action element. That way, flow admins can pass values between that attribute and the flow when they configure the screen field.

With this sample design resource, flow admins can customize the values for the “Hello World” component’s attributes.

1<design:component>
2   <design:attribute name="greeting" label="Greeting" />
3   <design:attribute name="subject" label="Subject" />
4</design:component>

A design resource describes the design-time behavior of a Lightning component—information that visual tools need to allow adding the component to a page or app. Adding this resource is similar to adding it for the Lightning App Builder.

When admins reference this component in a flow, they can pass data between the flow and the Lightning component. Use the Inputs tab to set an attribute using values from the flow. Use the Outputs tab to store an attribute’s value in a flow variable.

In this example, the Inputs tab sets the Greeting attribute to Hello and the Subject attribute to World.

In a Lightning component screen field, the Greeting attribute is set to "Hello" and the Subject attribute is set to "World".