Pass form details to your bot
# đź“–tutorials
The website demo is available here: Let's simplify the tutorial for passing form details to a chatbot: Start by using the
custom payload
trigger instead of the usual
Conversation Start
trigger to initiate the chat when the form is submitted. To bring the trigger payload into your bot, use this code:
Copy code
const { name, email, linkedin, message, position } = event.payload.payload
Create a form on your website:
Copy code
<form id='myform'>
  <label for="name">Full Name:</label>
  <input type="text" id="name" name="name" required>
  <label for="email">Email:</label>
  <input type="email" id="email" name="email" required>
  <label for="linkedin">Linkedin URL:</label>
  <input type="text" id="linkedin" name="linkedin" required>
  <label for="message">Cover Letter/Message:</label>
  <textarea id="message" name="message" rows="7"></textarea>
  <button type="submit">Submit</button>
Embed your bot with this code, ensuring that the chat widget is hidden:
Copy code
    "composerPlaceholder": "Chat with bot",
    "botConversationDescription": "This chatbot was built with Botpress",
    "botId": "da359935-a341-4c1d-bc05-cbdbd10a5444",
    "hostUrl": "",
    "messagingUrl": "",
    "clientId": "da359935-a341-4c1d-bc05-cbdbd10a5444",
    "lazySocket": true,
    "hideWidget": true,
    "useSessionStorage": true,
    "enableConversationDeletion": true,
    "showPoweredBy": true
Use the form submission button to start the chat:
This code ensures that the bot widget is ready before sending the payload to the bot. Use
to match the bot's trigger for payloads. Now, you should be able to see the payload in the bot logs when everything works correctly. Happy bot building!
It happens so that yesterday as was working with this functionality. What I couldn't figure is if it's possible to see incomming trigger payloads in the Botpress studio. Documentation and some Youtube videos says that it's possible, but somehow I can't find how to do it.
@bumpy-butcher-41910 do you have a solution on how to deal with a situation when a chatbot is already in the state of waiting for "raw input", let's say from the previous conversation that hasn't ended? The problem with this situation seems to be that the bot is waiting for the raw input and you just send it a trigger payload and it doesn't (I assume) accept it and asks again in the chat for that raw input.
I know it's possible to initiate a new conversation, but is there a way to just end the current conversation and then send the trigger payload to the bot after the conversation ended?
@mammoth-lamp-91104 it is still in beta 🙂
Where is the trigger connected in your bot?
@famous-jewelry-85388 So I watched this videoâ–ľ

and in there logs have payloads that are incoming from the web. I personally don't see payloads in the logs and I can't figure out why is that. My setup is simple and it works as expected. I have custom trigger in a separate workflow. When I send the paylaod from web, it gets triggered and works as expected.
I am sorry, but can we move this discussion to #1111009377525186570 ? and mention me on it so we don't add information to the tutorial that is not related ot it?
im going to use this
thanks for the video !
can you do this for changing a bots question towards a user ?