I have a LWC which stores the URL Parameters in local storage [this works]
I wanted to retrieve the values on a specific screen flow. Using a display text function I tried to see the values if they were retrieved or not, apparently they are "null".
In the flow I have added the LWC component and based on its properties I have created the variables as "available for output" and used this syntax to display "{!var_FirstName}" where it is showing null
What am I Missing here? Can you please check and let me know
JS
import { LightningElement, api } from 'lwc';
export default class RetrieveParams extends LightningElement {
@api language;
@api varFirstName;
connectedCallback() {
// Retrieve parameters from local storage
this.language = localStorage.getItem('language');
this.varFirstName = localStorage.getItem('var_FirstName');
// Dispatch event to pass the parameters to the flow
this.dispatchEvent(new CustomEvent('parametersready', {
detail: {
language: this.language,
varFirstName: this.varFirstName
}
}));
}
}
HTML
<template>
</template>
Meta XML
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"
fqn="retrieveParams">
<apiVersion>56.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__FlowScreen</target>
</targets>
<targetConfigs>
<targetConfig targets="lightning__FlowScreen">
<property name="language" type="String" label="Language"/>
<property name="varFirstName" type="String" label="First Name"/>
</targetConfig>
</targetConfigs>
</LightningComponentBundle>