@acceptable-gold-88171 I have a link on my webpage that, when clicked, successfully sends a text payload to Botpress. I see the payload in the UI along with the correct target node value. However, this payload always goes through the "Start" node, preventing my custom trigger from firing. Here's what I've set up:
HTML Link:
What is Knowledge gathering and integration
JavaScript: Sends type: 'text' payload when the link is clicked.
Custom Trigger Node ("kb_query"): Has a Basic Transition with the condition event.type === 'trigger' && event.payload && event.payload.targetNode === 'kb_query'.
Questions:
Is it common for a 'text' payload to be routed to the "Start" node, even if it has a targetNode value?
Could the way I'm sending the 'text' payload be blocking the separate custom trigger mechanism?
Could you help me troubleshoot why my custom trigger isn't firing, even though the rest of my setup seems correct?
This is my full code:
What is Knowledge gathering and integration
document.addEventListener('DOMContentLoaded', function() {
const chatTriggers = document.querySelectorAll('ul li a');
chatTriggers.forEach(link => {
link.addEventListener('click', function(event) {
event.preventDefault();
const messageText = this.textContent.trim();
const targetNode = this.dataset.node;
// Open the webchat and send payload
window.botpressWebChat.sendEvent({ type: 'show' });
window.botpressWebChat.sendPayload({
type: 'text', // Send as a regular text message
text: messageText,
targetNode: targetNode
});
});
});
});
Thanks
https://cdn.discordapp.com/attachments/1220617496974065664/1220617498098008095/image.png?ex=660f97a1&is=65fd22a1&hm=04c284ba0d84224b3c8c691af0caa0b9ad70eaad910f862fa8757831fd4b166d&
https://cdn.discordapp.com/attachments/1220617496974065664/1220617498467110972/image.png?ex=660f97a1&is=65fd22a1&hm=bdf62cb66aebd2dc8a63da9d87de029cc83134ae28453249ed581096ae553fca&