Whatsapp integration
# 🤝help
h
Hello! I’m building my project and I have recently discovered botpress. I’m trying to build a project for schools, and the first step of this chatbot is to analyze the number who writes to this chatbot This chatbot will be implemented with WhatsApp. I will explain you the whole idea of the bot so you can understand it better I’m making a chatbot for a school so parents can have meetings with their child’s teacher I’ll have a total of 4 databases The aim of this bot is thhat with the first step of the bot (analyzing the number of the parent from the chat from whatsapp), you can associate each parent with his child, and so on, each child with each teacher So the parent can select which of his children wants to talk about, and with the specific teacher So I'm struggling with to main problems: The first one, I don't know how can I make that botpress can save the parent number in order to associate it with his children and so on The second one is that for example, how can I make in botpress that if the parent has selected a child, how can I make that the next step it will be with the teachers associated with that specific child (They will be associated with the database) Thanks for your time, I appreciate it a lot 🙂
b
"The first one, I don't know how can I make that botpress can save the parent number in order to associate it with his children and so on" since this is structured data, it sounds like you should be using Tables to associate a number to a specific student/parent
same with the second point - since specific teachers are associated with specific children
f
h
Hello @fresh-fireman-491, I have a question about this variable. Do you know how can I save the variable, and check if that variable is in a specific column (the collum name is Numero) inside the table named PadresTable.
When someone writes to the chatbot through whatsapp I would like to save the variable and check if the number is inside the column
f
Hey there, You can find it like this, with an execute code card:
Copy code
javascript
workflow.records = await PadresTable.findRecords({
  filter: AI`Phone number is ${event.tags.conversation['whatsapp:userPhone']}`,
})
You can insert the record by adding an insert records card like this, and then having
{{ event.tags.conversation['whatsapp:userPhone'] }}
in the column. My column is named phoneNumber, and my table is named usersTable. Here is an example of how that would look: https://cdn.discordapp.com/attachments/1232042753462894775/1237112585300475975/image.png?ex=663a7660&is=663924e0&hm=d6bdd8f23a6d5f70a32d5d00bd2d5fd8fcc84d852fce922706f6d20abb28e60c&
a
oh this is what i was looking for kinda
@hundreds-hair-29881 but have you got it working?
h
Not yet
Im working on it
What do you currently have?
@astonishing-engine-80910
a
i have made it have converstational memory replies
yeah thats about it
h
Can you tell me how did you do it, please? @astonishing-engine-80910
I’m having a lot of problems
a

https://www.youtube.com/watch?v=p1-iBvEuTzA

https://www.youtube.com/watch?v=Q2VMitD6DMU

these two videos
combine em
h
Thanks