I have a Lightning record page and just want to include the recordId
in my JSON string variables passed to Flow. I understand including the decorator, etc I just cannot seem to get the correct format for including the recordId
in the JSON.parse(this.flowParams)
. Passing regular String variables are working fine.
I'm also not clear if using this pattern I still need to include the recordId
in the <targetConfig><property>
section? I think no.
[{"name": "recordId", "type": "String", "value": "{!recordId}"}]
import { LightningElement, api } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class cardNpiSingFlowCmp extends LightningElement {
@api flowName;
@api recordId;
@api flowParams;
@api vaEntryPoint;
get inputVariables() {
return JSON.parse(this.flowParams);
}
handleStatusChange(event) {
if (event.detail.status === 'FINISHED') {
// set behavior after a finished flow interview
}
}
}