Dialogflow CX (retrive chat pramater)

I am integrating Dialogflow CX with React and Node.js. I want to retrieve the chat parameter on the React side when the session ends. Is there a way to achieve this?

I want the javascript function to get the parameter when the session ends so I can send the parameter to the backend with the current login user ID.

@xavidop

Hi,

you will need to query the bigquery dataset that stores all the conversations. with the session ID of that user.

Xavi

Alright, I’d like a JavaScript function similar to those mentioned in the Dialogflow CX documentation. For instance, I’ll provide an example in the message. I’m looking for a function similar to df-response-received that captures the chat parameter when the session ends. Are any other functions available for this purpose?

yeah,

There is one called df-session-end. You will need to use that one!

Best,

Xavi

Yes, df-session-end is available, but I’m specifically interested in a function that provides the chat parameter when the session ends.

Hi!

I did not get that, what do you mean by chat parameter?

Best,

Xavi

window.addEventListener(“df-messenger-loaded”, () => {

// response received event
window.addEventListener(“df-response-received”, (event) => {
– get parameter from event object and stored in the state(used VUE JS)
parameters.value=event?.detail?.raw?.query result?.parameters
});

// session end event
window.addEventListener(“df-session-ended”, () => {
//Here we can get the value of the session parameter and send all parameters to the database with user credentials so it stores with corresponding user
});
});

Will this logic work?

yeah, @mohduvesh043 that is what I suggested

1 Like