nikola3103
nikola3103

Reputation: 133

IBM Watson Assistant - store slot data in custom defined entitiy?

I am using slots in one of my nodes in the dialog of IBM Watson Assistant. The issue is none of system provided entities for slots(sys-person, sys-percentage, sys-number...) does not fit my need.

I need a company name to be saved. So I created my own entity named @companyName added pattern, and when the user enters value it is recognized by the entity pattern but the data is not saved to the entity.

How can I save the answer the user gives to that question in the my entity @companyName

screenshots:

entity definition

enter image description here

conversation with the bot

---

Upvotes: 0

Views: 712

Answers (2)

nikola3103
nikola3103

Reputation: 133

I figured it out!

Everything that I had to do is append .literal in the second screenshot after the Check for: @companyName.

So now the slots part looks like this, and we have the entered value inside the variable $companyName

enter image description here

I found it in the official documentation, more precisely here: https://cloud.ibm.com/docs/services/assistant/dialog-slots.html#dialog-slots

(under number 4. Add a slot for each unit of required information. For each slot, specify these details)

Upvotes: -1

data_henrik
data_henrik

Reputation: 17118

You don't want to save the entity, but its value...:

You would need to check for @companyName.value and save it to the variable $companyName. See this slot using tips in the documentation for IBM Watson Assistant.

This tutorial showing a database-driven chatbot uses patterns to capture data and the code is available. Examine it for some coding examples.

Upvotes: 2

Related Questions