IBM Watson Slots won't accept 0

Viewed 645

I'm trying out the slots feature in IBM Watson Conversations and have hit an issue which I'm not sure how to work around.

I have a use case that is collecting a number of pieces of information from a user so using the Slots feature makes sense. Unfortunately when I add a Slot with @sys-number the system will not accept 0 as a valid input. This slot is in fact required but 0 is a valid value.

Anyone have an idea of how to have a required Slot of type @sys-number that accepts 0 as a value?

2 Answers

I had a similar problem with recognising zero values in slots and the system entity documentation did not explain it well enough (for me at least).

Further elaborating on Michal's answer above:

  1. Click the "Edit Slot" option (gear icon)
  2. Set the "Check For" attribute on a slot condition as entities['sys-number']

edit slot modal

  1. Click the edit slot modal menu options (three bubbles in corner)
  2. Open the JSON editor
  3. Change the context variable value to "<?entities['sys-number'].value ?>"

edit slot json editor


Result:

result

Related