2

The below link have enough information about embedding a LWC in Lightning flow but nothing about passing a variable value to LWC.

https://unofficialsf.com/adding-lightning-web-components-to-flow-screens/

For example:- I have a variable in Lightning Flow called 'NewRecord'. The below LWC .js not fetching the value from Flow.


import { LightningElement, api } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';

export default class TakeMeToClonedOrder extends NavigationMixin(LightningElement) {

@api NewRecord;
@api Message;

navigateToOrder() {
    this[NavigationMixin.Navigate]({
         type: 'standard__recordPage',
            attributes: {
                recordId: this.NewRecord,
                objectApiName: 'Order',
                actionName: 'view'
            }
        });
    }
}

2
  • Do you have all the other targetConfig properties set? Commented Oct 16, 2019 at 22:53
  • yes, it looks like below. <targetConfigs> <targetConfig targets="lightning__FlowScreen"> <property name="NewRecord" type="String"/> <property name="Message" type="String"/> </targetConfig> </targetConfigs> Commented Oct 16, 2019 at 23:11

1 Answer 1

3

Sorry my bad, the issue is resolved. I missed to pass the value in Flow Screen -> LWC component. enter image description here

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.