Introduction

This document will tell you everything you need to know about how intents get executed and how you can configure your intents to make engaging and entertaining skills for your users.

Intent Triggering

Intent triggering is an event or action that causes the intent to be executed.  An intent can be triggered (executed) in many different ways.

You define intent triggering on the Activation tab of the Intent Settings panel.

What the user says

The most common method of triggering an intent is by what the user says.  This option allows you to specify the things the user might say to trigger the intent.  For example, if you have an intent that gives the user their horoscope for the day, you might setup your intent like this:

 Whenever the user says any of the above phrases or anything similar, the intent will be triggered.

There are several "built-in" options that will also trigger the intent by what the user says, but they save you time because you don't have to enter any sample phrases. These options are:

  • When the user says "Help" - triggers the intent whenever the user says something that indicates they need help.
  • When the user says "Yes" - triggers the intent whenever the user says something that indicates the user means "yes"
  • When the user says "No" - triggers the intent whenever the user says something that indicates the user means "no"
  • When the user says anything - this option is a "catch all" option that will trigger the intent regardless of what the user says.  This intent will only be triggered if there are no other intents that are also triggered.

Another Intent

Intents can also be triggered directly by other intents.  Use this option if the intent should "only" be triggered by another intent and shouldn't be triggered in other ways.

Audio Player

If your skill plays streaming audio like podcasts, radio stations, ambient sounds, or other audio, then the user can say things like "next", "previous", "stop", "repeat".  They can also use the controls on the physical device or on a remote control to give the same commands.   You can create intents that are triggered by these commands:

  • Audio Player "Next" - triggers the intent when the user indicates they want to hear the next track
  • Audio Player "Previous" - triggers the intent when the user indicates they want to hear the previous track
  • Audio Player "Repeat" - triggers the intent when the user indicates they want to repeat the current track
  • Audio Player "Stop" - triggers the intent when the user indicates they want to stop playing the current track
  • Audio Player "Almost Finished" - this will trigger the intent when the currently playing track is almost finished playing.  You can use this to queue another audio file or take other actions.

In-skill Purchasing

You can monetize your skill content and allow your users to make one-time purchases, create subscriptions, and buy consumables.  As part of those purchasing flow, you can create intents that respond to certain events:

  • In-skill Product Buy Accept - triggers the intent when the user accepts the purchase of an in-skill product
  • In-skill Product Buy Decline - triggers the intent when the user declines the purchase of an in-skill product
  • In-skill Product Buy Already Purchased - triggers the intent when the user tries to purchase an in-skill product but it has already been purchased
  • In-skill Product Cancel Accept - triggers the intent when the user accepts the cancel of an in-skill purchase 
  • In-skill Product Cancel Decline - triggers the intent when the user declines the cancel of an in-skill purchase
  • In-skill Product Cancel Not Entitled - triggers the intent when the user tries to cancel an in-skill product purchase, but the purchase isn't active

Intent Activation

By default, intents can be triggered at any time.  You will likely want to create a logical flow to your skill so users can only trigger certain intents when you want them to.  You can do this by specifying the one or more intents that must be executed before the current intent will be activated and able to be triggered.

Let me give you an example.  Let's say I'm building a trivia game.  After the user opens the skill, we welcome them and then we want to ask them for their name.  After they give us their name, we want to ask them where they are from.  We don't want them to be able to tell us where they are from first.

So, we'll create three intents, "Welcome", "Name", and "Location" and we want the flow to be Welcome -> Name -> Location

To do this, we set the "Name" intent to be only activated by the "Welcome" intent.  This means the "Name" intent cannot be triggered unless the "Welcome" intent is the current intent.  Voice Apps will draw a connecting line with an arrow pointing from the "Welcome" intent to the "Name" intent.

Similarly, we set the "Location" intent to be only activated by the "Name" intent.  This means the "Location" intent cannot be triggered unless the "Name" intent is the current intent.  Again, Voice Apps will draw a connection line with an arrow pointing from the "Name" intent to the "Location" intent.

Continuing this process, you can create skills that guide the user from step to step and prevent them from triggering intents before you want them to. This will make a much better user experience!

Conclusion

In this lesson, you learned all about intent Triggering and Activation.  In the next lesson, you'll learn about Variables.

Did this answer your question?