Catchall Intent for Voiceflow ->Intermediate

I’m old, and inquisitive by nature, but I always think like a teacher!

I usually try to keep my ‘user replies‘ as simple as possible because, as we all know, Alexa isn’t perfect!

I found a way to get what the user says, up to a sentence or two, by forcing them to say a key word, followed by what they want me to hear. If you would like that explained in a later tutorial, let me know.

Yet, what I have always wanted, was a way to ‘catch’ what the user says. This would allow me actually understand what they said, that did NOT satisfy the Intent(s) that I included in an Interaction Block. For that situation, where you just can’t get the user to say what you want, the way you want to hear it! Those situations where they said something, yet for some reason, the ELSE output wasn’t triggered, or it was and the user didn’t understand why.

I’ve seen it explained before, but I could never quite grasp what was being explained. So, since I didn’t have any MAJOR NEED, at the time, I just gave up and kept trying to change the questions to the user, to try to get the answers that I wanted.

Like I have said before, I’m a retired teacher. Yesterday, another Voiceflow user asked me if I had seen the video explaining how to do a catchall intent. I hadn’t, and I told her that. She said she had seen it, but she just couldn’t figure it out. That reminded me of my earlier attempt to understand how this works. It also got my ‘inner-teacher‘ working!

NOW, I had a reason to learn it! Someone I knew needed to know how it works! So I asked for the link to the video and watched it.

Well, 10 minutes later, after I finished watching it, TWICE, I had to admit to her, that I still didn’t get it! I went back to it and watched it again. Nothing…. I could not understand it. That was all it took! I turned the sound off, and looked at the ‘pictures‘!

Like they say, “a picture is worth a thousand words!

I think I just added a corollary to that.

If you don’t understand the verbal explanation, refer back to the pictures! 

20 minutes later I had a sample project running, and I actually understood how it worked. Naturally, I immediately shared it, and my explanation of how it works with the person who needed it. The one who told me she didn’t understand the original video.

Here’s a link to that video. If you only need the video to understand it, skip this tutorial, because you don’t need it!

Now, let’s get this tutorial going.

What I have created is a very simple project that asks a question, uses a slot to get the expected answers and a second slot to catch all other answers. A catchall slot.  I then set it up as a combined block so you could see both ways of doing it. Here’s what it looks like when it’s finished


The Combine Block is hooked up in the image above, but I have also shown the individual blocks above it. The main block is the Interaction Block. It has 2 numbered output ports, and the else port. I will explain how it was created, with special emphasis on the Slots, Intents and Choices.

— slots —

In the “which user” Speak Block, the user was asked this question. “which meeting should we attend?”.

Here are the two slots I used.

  1. First, I created a slot called “slot_meeting_name”.
  2. Then I chose “Custom” as the Amazon data type, because what I wanted didn’t fit any regular data type.
  3. There were 4 different possible answers I expected from the user, so I entered each as “slot content examples” (“customer service”, “sales “, business”, and “advertising”).
  4. Knowing that it was possible that the user could say something other than what I expected them to say, I decided to add a second slot.
  5. I called it “slot_catchall” because I wanted this to capture anything else the user might say, like possibly “let’s just skip the meeting”, or “customer stuff”, or ANYTHING else!
  6. I knew the user could say anything, and I wanted to use the Amazon Custom type again, BUT I wanted to catch EVERY WORD the user said, and when you use that data type, you have to add at least ONE word with the [slot] when creating an Intent. If you use the Amazon BOOK type, you can use JUST THE SLOT, when making an Intent. That may mean nothing to you yet, but hang in ’til I reach the Intent section and you will see how that helps.
  7. Since I had no idea what to expect from the user, I did NOT put anything in as a “slot content example”.

The 2 slots are now done, so let’s move on to the Intents.

 

— intents —

We’ll start with the “intent_meeting_name“.  Remember, the [slot_meeting_name] is meant to expect one of 4 possible words or phrases, (“customer service”, “sales “, business”, or “advertising”).

This tutorial assumes that you know how to add a slot, (by typing the left square bracket, “[“, and choosing the slot you want to use).

I included 4 different synonyms for the intent. (Remember the first one for later when we test it on ADC.) They are all common ways the user could answer the question, with what you wanted them to say, and they are all obvious suggested answers. There are tons of others you could include, and after testing, you will most likely find the need to add more later. But, for the purpose of this tutorial, I’m done with it.

The “intent_catchall” is a little different. We did NOT include any “slot content examples” when we made the [slot_catchall]. If we wanted to use the Amazon Custom type here, then we would need to add other words in the synonym area.

Since we chose Book as our Amazon input type, we do NOT need anything else, just [slot_catchall]. This means the user could answer with, “Hi Bill, why is this stupid question being asked?” and it would be added to the [slot_catchall] slot. We don’t need to add any other combinations, just the catchall slot!

Believe it or not, all of the hard work is done now.

Let’s move on, to our 2 choices.

 

— choices —

Obviously we want a choice that uses the “intent_meeting_name” because that is our man goal here.

If you check back to the diagram of the project, it is the number 1 choice for our Interaction Block. It connects with the Speak Block called “gotcha”. The speech for that block is:

OK, we’ll go to the {meeting} meeting.

It sounds wrong,  but if you substitute any one of the 4 possible example words from that slot, (“customer service”, “sales “, business”, or “advertising”) it’s perfect.

  1. First, we give the choice a name, “intent_meeting_name”.
  2. Then we select the appropriate slot to map it to, [slot_meeting_name].
  3. If we haven’t already done so, we create a variable called {meeting}.
  4. Finally, we map that slot to the new variable.

With the catchall intent, I followed all of the same steps. We could have used a different variable, and done all sorts of useful things with the data we got, but I used the same variable.

Voila, the Interaction Block is now complete.

I directed the number 2 output of the Interaction  Block to a Speak Block called “catchall”. The speech for that block is:

you said {meeting}.

I directed the ELSE output of the Interaction  Block to a Speak Block called “huh?”. Else doesn’t get a value for the variable. The speech for that block is:

“Sorry, but I don’t recognize that as a meeting type!”

Here are a couple of tests done using ADC (alexa developer console).

Look VERY CAREFULLY at the results!

    1. First I answered, “let’s go to the zoo”. That was a totally weird answer to the question, but it was captured! Then it was sent to the “catchall” Speak Block, and I was told it didn’t understand, but more importantly, it captured the text and repeated it to me. I’m sure you can think of a million uses for the data, like adding it to a Google Sheet specifically for seeing what answers the user might give.
    2. Then I said “customer support”. It did NOT see that as a correct answer to the question. If you try this using Voiceflow’s Test Button (as of this date) this works. BUT if ADC won’t accept it, it isn’t a valid possibility. Therefore, using JUST THE SLOT as a possibility for a sample Intent, is NOT a god idea, in this case.
    3. I chose one of the suggested ways to say a correct response, by adding the word ‘group’ after saying which meeting I wanted to attend, and it worked!

 

 

Here are 5 important things to get out of this tutorial.

  1. Even though you CAN include an intent for a slot that uses the Amazon Custom type, with no additional words added, you probably shouldn’t because it usually won’t work. That will make your skill appear poorly planned, and it will also make Alexa seem stupider than a lot of people already think she is!
  2. You should always enter as much slot content as you can think of, and as many synonyms (in your intents) as possible. AND definitely get people to test your intents, before your skill goes live.
  3. If you use a catchall choice, your ELSE output probably won’t do anything.
  4. As I have just demonstrated, you CAN capture all user input, if you want to. If you decide to do this with a live skill, have a specific reason to do it. See # 5 for possible uses.
  5. Here are a couple of ways you can use the data that you get from a catchall intent. Take all of the data that you get, and save it somehow (as cells on a Google Sheet maybe?), to help you develop better skills. Or use it so you can tell the user EXACTLY what Alexa heard, followed by an example of what you expected them to say.

OK, I’m done with the tutorial. I hope this helps some of you. As always, have fun………

I’m adding a new tutorial that was inspired by this one. it’s called “Saving Catchall & Error Message Data ->Intermediate“. it will explain how I have added a google Sheet to collect data from a new skill I’m creating. It will ‘catch-and-save’ my catchall data, as well as any possible error messages that would arise from the testing of the project.

Search

About This Site

This site was created as a place for users of our Alexa skill to find more information about creating their own skills, without programming.