3

I am trying to pass SObject list from LWC to flow.

I have set the property and property type.

<targetConfigs>
     <targetConfig targets="lightning__FlowScreen">
          <propertyType name="T" extends="SObject" label="Input Type" description="Generic sObject data type used for input sObject properties" />
          <property label="Select SObject" name="recList" role="inputOnly" type="{T[]}" />
     </targetConfig>
</targetConfigs>

I have also set the required elements in the flow.

enter image description here

When I run the debugger , I can see the values in the recList . But it is not being passed to Flow. Please help!

Thanks

1 Answer 1

3

Two things:

  • Make sure you publish the event to the flow using the FlowAttributeChangeEvent event.
  • Outputs from an LWC FSC cannot (as of v.53.0) be listened to by other elements on the same page. The values are only available once you click next. i.e. Try creating another screen, and output the values there.

Publishing the event

See https://developer.salesforce.com/docs/component-library/documentation/en/lwc/use_flow_runtime_considerations

Lightning web components use events to report changes from components to flows. To notify the flow runtime of attribute changes, a component fires the FlowAttributeChangeEvent event.

1
  • I added the FlowAttributeChangeEvent and added another screen. SCREEN: Bulk Upload CCs Lightning Component: addCaseContacts Screen component: c:addCaseContacts Inputs: recList = recList (null) Outputs: null Display Text: test1 Value at run time: recList is null.
    – Valkarie
    Commented Oct 21, 2021 at 4:12

You must log in to answer this question.

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