0

I have created one LWC component where the fields are First Name, Last Name, Email, and Country. This LWC component I have added in the chatbot as a question. When we submit the form the data is getting stored in one variable using postmessage. I want to store the different fields in different variables like the first name from LWC to the First Name in the chatbot variable.

This is my component see the component

This is my line of code from where I am passing the message

let message = 'Your case number is '+':'+result + '\nfirstname' +' :'+this.ContactFirstName+'\nlastname'+':'+this.ContactLastName this.dispatchEvent(new CustomEvent('postmessage',{ detail:'lwc:hide:'+message

message is getting displayed as enter image description here

I want to separate first name and case number and stored different chatbot variables.

0 Answers0