No variable retention after whatsapp start convers...
# 🤝help
b
The flow of my bot should be: - if a new lead is added in the crm, sent a post req to bot's webhook with all necessary data to send a whatsapp template message with 2 buttons - store important data in workflow variables and user variables - send message successfully - waiting for user choice - if the user press the button on whatsapp's message an API call will be execute to store the choice into the crm, OR if the user start to ask something, the bot reply from KB. at the last point I'm stuck because I lose all the variables. Somehow the variables desappear... I think that is because I created two different triggers that create two different conversations, so the previous variables are not accessible.... I'm sure that I'm missing something, but I have no idea what Can someone try to help me? thank you very much!
l
At the last step, the button response is received at Botpress right? It only has the button information and nothing else? I hope I understood your scenario. If yes, try below Is it possible for you to store the values in a table along with the conversation id and phone number? Once the button input is received, retrieve the values from the table, update the CRM and delete the record in the table..
b
Thank you for your answer! Yes, Botpress receive the response but my concern is that the bot create a new conversation, different from the conversation created when I trigger the Whatsapp's template message... I say that because in Conversations tab, when i trigger the WA's template message, the bot create an empty conversation (see the screenshot). Note that the user never started a conversation before. But when the user reply, create another conversation (the one with name in the screenshot)
l
can you write a console.log(event.conversationId) on receiving the response and see if the conversation Ids are the same or different. It could also just mean that you workflow ended and it started a new conversation
check for End of Workflow message as well
Try the method of storing values in a table
b
Hello. I checked the logs and yes, the conversation Ids are different and at the moment I'm not able to keep active the first conversation. So I'll follow your suggestion about the table storage. Thank you!
l
Also check the bot timeout in the settings, extend it for your use case
10 Views