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? Oct 16 '19 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> Oct 16 '19 at 23:11
2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.