LWC FlowAttributeChangeEvent issue

404 Views Asked by At

This is my variable

textVal==>{"Basin":["Atlantic"],"Storm Name":["ALEX","BONNIE","COLIN","DANIELLE","EARL","FIONA","FIVE","GASTON","HERMINE","IGOR","JULIA","KARL","LISA","MATTHEW","NICOLE","OTTO","PAULA","RICHARD","SHARY","TOMAS"],"YEAR(Date)":["2010"]}

before passing I console the textVal and am getting as expected

const attributeChangeEvent = new FlowAttributeChangeEvent('jsonData', textVal);
// Dispatch the attributeChangeEvent
this.dispatchEvent(attributeChangeEvent);

// Finally, trigger the navigation event
const nextEvent = new FlowNavigationNextEvent();
this.dispatchEvent(nextEvent);

when am trying to pass the data to the next screen am getting only {"Basin":["Atlantic"]}

am not sure why it's happening

1

There are 1 best solutions below

0
On

I found the reason before updating the textVal it's navigating to next screen so what I was I added a setTimeout() in the navigation part and it worked as I expected this is the code

setTimeout(() => {
const navigateNextEvent = new FlowNavigationNextEvent();
this.dispatchEvent(navigateNextEvent);
}, 1);