How to retrieve the form data that users fill in wix chat using code

Question:
wix chat has a form that users can fill ,is there any way to retrieve the form data using code?

Product:
wix editor, wix studio

What are you trying to achieve:
need the user data from wix chat’s form to send it to zoho crm

What have you already tried:
i tried using onContactCreated event , when users submit the forms their contact gets created and the event gets fired , but with this way i am not able to access my data that i am getting from my frontend , I also tried the backend event of wix-chat and onSubmissionCreated event but i couldn’t recieve the form data.

Hi, Krishna_Menon !!

Were you able to retrieve the values of non-form messages in the Wix Chat backend events? :thinking:

1 Like

yes, i am able to get chat messages from the backend events , but while form submission the payload comes empty object

Is it something like this code? :thinking:

/**********************************
 * Backend event code - events.js *
 **********************************/
export function wixChat_onMessage(event) {
  const chatMessage = event.payload.text;
  const chatParticipant = event.participantId;
}

Cited from: on-message

yes, i am using this one.

Are you placing this code inside the events.js file?

Obviously, i am putting the code in event.js file . i am recieving an empty payload on submission of the form . I am just recieving a message “Form submitted via wix chat”