0

In my winter 20 pre-release org, I am getting error while dragging screen in lightning flow. Error is

"This page has an error. You might just need to refresh it. [PromiseRejection: [object Object]]".

Also, I can't find my lightning web components in flows and can't find components installed from AppExchange in flow.

Can anyone please guide me so that I can access my Lightning Web Components from Lightning Flow.enter image description here

2 Answers 2

1

You need to add a target to your xml file like this:

<?xml version="1.0" encoding="UTF-8" ?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>46.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__FlowScreen</target>
    </targets>
</LightningComponentBundle>

It will then be visible for you in a screen element in Flow Builder.

1

Here's a good article on the UnofficialSF site that walks through implementing LWC in flows. It includes the metadata configuration, how to trigger flow navigation, validation, and the eventing required to make sure the flow knows about updates to your output attributes. https://unofficialsf.com/adding-lightning-web-components-to-flow-screens/

Here are the official docs in the LWC Dev Guide:

https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.use_config_for_flow_screens

https://developer.salesforce.com/docs/component-library/bundle/lightning-flow-support/documentation

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .