How to set temporary variables in a custom component

Hello, I created a custom component with a form that saves the data in Firestore DB, the component works correctly, but I can’t find a way to send the confirmation or error response to the user after submitting the form.
Has anyone had this scenario and how did they solve it?

Thank you.

Hey @toni
You can use the replyToEvent() function of the Botpress SDK to send outgoing events to your user.
Please let me know if you need an example.

Hi @spgin
I was using the onSendData function when the user press the submit button and in the payload value pass the response someting like this:
//This will act as if the user typed ‘submit’ and pressed enter.
this.props.onSendData({ type: ‘text’, text: ‘submit’, value: this.state.respValue })
I will try using replyToEvent ()

Thanks for answering.