0

I want to capture the following input from the user and am using these entities:

  • First and last names: use sys-person (I extract first and last names later using a cloud action).
  • Email address: use pattern entity, name @contactEmail and value "email" pattern \b[A-Za-z0-9._%+-]+@([A-Za-z0-9-]+.)+[A-Za-z]{2,}\b
  • Mobile Number: use pattern entity, name @contactPhone and value "mobileNumber" pattern ^[1-9][0-9]{7}[0-9]+$

Slots

I created a node with slots:

Slots

The setup is as follows:

Check for:

  • Check for: @sys-person.literal Save it as $person If not present: Type your name
  • Check for: @contactEmail.literal Save it as $email If not present: Type your email
  • Check for: @contactPhone.literal Save it as $contactPhone If not present: Type your mobile.

This all works perfectly and I get the name, email address and Phone number.

The Challenge But I want the user to be able to confirm that the details are correct. So I have an intent called #response_yes which is activated by things like "yes", "yep", etc.

And I have a fourth slot that checks for #response_yes.

  • Check for #response_yes, store the value in $confirmed, if not present ask "Got $person, $contactEmail, $contactPhone is that correct?"

Confirmation

If #response_yes is not found, then it displays the values already typed and asks if they are correct and waits for user input.

After the user has responded, then if the #reponse_yes intent is still not found, then:

Start again

Respond with, "Let's start again". Also, we need to clear the values already typed:

Clear the values

Here's where it goes wrong When I try the chatbot, the node collects the input correctly and displays the values correctly and asks if they are correct. I type "no", the #response_no intent is correctly divined and I would expect the prompt for the first slot to show again, but it doesn't.

The problem

No matter what I type at that point, the assistant bypasses the top three slots and drops to the fourth one again. It's as if I need to clear the entities, not the variables.

What am I doing wrong? How do I make the top slot work again?!

Rubén
  • 34,714
  • 9
  • 70
  • 166
Rob Mousley
  • 89
  • 1
  • 5

1 Answers1

0

Aaaaargh.

For anyone who's interested, I simply didn't reset the values to null.

I guess I assumed that leaving the value blank was the same as null. Not so. Once I did this, the system worked perfectly:

Set the values to null!

Rob Mousley
  • 89
  • 1
  • 5