-2

we'd like to keep user on the same prompt when they enter the wrong number, we have tried anything_else, and "true", "jump to", but it messed up, please take a look at the attached to reproduce it, Thanks

  1. pleae enter "how much"
  2. if you enter 6, it will lock the prompt(I assign 1 to 5 to different identification), this behavior is correct .
  3. then enter 2, we will get messed up...

please import this json to reproduce it, thanks https://drive.google.com/file/d/0B1YdUMoS4l7ub1BZdUg1c1dQeG8/view?usp=sharing

  • one more request, we'd like to enter a flexible salary in this case, unfortunately , we can only enter fixed value which was predefined in entities. –  Mar 31 '17 at 06:53
  • No. You need to add the code into the question. A link to a google drive link is not enough. Specifically to have a link to the code is ok to make it easy, but it also needs to live on the question in case the link breaks. What if you delete it from google drive? – Lexi Apr 05 '17 at 13:02
  • workspace03 is brand new to reproduce my case , Thanks –  Apr 05 '17 at 13:08
  • sorry , I got a little bit confused on "check my edit please" ? is it on your google drive? –  Apr 05 '17 at 13:21

1 Answers1

0

The better form is use the entitie pre-defined by IBM, @sys-number to get numbers from the user input. And you can use use with conditions and to get the number with context variable too, check the JSON example:

{
  "context": {
    "number": "<? @sys-number ?>"
  },
  "output": {
    "text": {
      "values": [
        "Now is $hora. Sector please?"
      ],
      "selection_policy": "sequential"
    }
  }
}

If user type two or 2, the entitie recognize!

You can use regex expression to obtain only the numbers you have pre-defined too!

How to active: -> Entities -> System Entities -> sys-number = ON:

enter image description here

Obs.: Waiting Watson TRAINNING after you active this entitie.

Example, with sys-number add in your node condition:

@sys-number:1

Check the image: enter image description here

If user type the number correct:

enter image description here

Check the dialog if user dont type the correct number with true condition:

enter image description here

I did the example for you understand what I do for that:

  • Download the JSON for verify how to do it with REGEX here.
  • Download the JSON for verify how to do it with SYS-NUMBER here.

EDIT:

Refer your questions In this case you can use regex, and use the context variable for make conditions in other node. My workspace with regex can help you with numbers. And, the variable $number you can use in the next node to verify if the user typed correctly the number.

And, the other case is to use the Jump to inside conversation. And use true if the user dont type the number correctly again.

Check my image:

enter image description here

Download the new workspace here.

Study more about conditions here.

Sayuri Mizuguchi
  • 5,250
  • 3
  • 26
  • 53