2

Hi I'm training my Watson Assistant (Classic) to ask the question, "How much is your vehicle worth?" If assistant recognizes @sys_number, their response saved in a variable $vehicleworth as " < ? input.text ? > ". This was fine until a user accidentally wrote 5--- instead of 5000. This was saved as just 5 instead of 5000.

The question is: How or can I limit the user's input to only numbers? Or what would I be able to do to recognize this "5---" as an incorrect input?

Thanks in advance! Respectfully.

HarveyBot
  • 21
  • 4

2 Answers2

2

In Watson Assistant Actions: you can use regex validation , there are good examples here

In Watson Assistant Classic create entities with a pattern as described here

Dudi
  • 2,340
  • 1
  • 24
  • 39
0

In Watson Assistant, you could perform an input check. You could try to convert the input to a number. If the conversion fails, the result is null. After the conversion, you would check for null and respond that invalid input was entered and ask again.

data_henrik
  • 16,724
  • 2
  • 28
  • 49