How to store Questions and Answers in a Table
# 📖tutorials
b
This is a quick tutorial about saving any Q&A in a table (template shared below). You have to set up your Knowledge Base, add a Raw Input card and save the question inside of a variable (we'll call it Question). Now: 1- Create a Table and add two columns, one for the Questions and one for the Answers 2- Add the "Insert Record" card in your conversation flow 3- In the the "Insert Record" card, coose the table you created 4- You'll have two inputs. In the Question input, write the variable you created (@workflow.Question). In the Answer input, type {{turn.KnowledgeAgent.answer}} Now you'll find each question and its relative answer inside of the table. You can do the same with Single Choices and basically any kind of variable you save. You can also handle when the Knowledge Base doesn't answer (look the template below).
c
Great stuff @brainy-summer-1041 ! thanks for sharing 🙂
b
I'll share another one in a second @crooked-van-25152
I want to become a BotBassador 😉
c
Awesome !!
m
hi it says failed to import bot
how did you even get to the 4th step
b
Did you create a Table? Did you add 2 columns (one for the questions, one for the answers)?
m
yes
nevermind i dunt think this is the solution i am looking for,
@brainy-summer-1041 i am trying to capture more than 1 input in the same variable as i am doing a qna loop where i capture the unanswered questions as raw input, but when i was testing the bot, only one question can get captured while all previous questions get kicked out of the variable, is there any way to get around this
b
The variable updates every time a user asks a quesion. You must make sure the conversation flow passes by the "Insert Record" card every time the user asks a question.
You can't just use it one time and add every single question he asked, you will only add the last one. Make sure the "Insert Record" card is a part of the question loop
a
Nice one @brainy-summer-1041, thanks for sharing... A great trick on using tables! You just gave me a great idea on using tables as a price list and summoning the answer when asked about a certain item 🤓 I'll have a go at that will share if it works 👍
j
nobody knew this ?
i just saw this post
i could have done this post since 3 weeks of my joining
i just execute the code to save invalid question
becuase im a coder now :)))
@agreeable-diamond-41265
a
Thanks for tagging me🙂
j
np
20 Views