Search code examples
actions-on-googleactions-builder

Actions on Google NO_MATCH handling


In the Actions Console one can specify a NO_Match when a user's response does not match an existing parameter. But that NO_MATCH does not provide a transition to another scene. When the user input is not recognized, I want to return to the start of the conversation and start over. How can I do that?


Solution

  • It does seem odd that the only transition that NO_MATCH supports in the Actions Builder/SDK is to the (mandatory) End Conversation scene. But this is more a conceptual notion - NO_MATCH indicates that you want to attempt conversation recovery, or that you're giving up on it.

    If you want to capture what is said and/or take action on it (ie - transition to a different scene) you can do something like this:

    1. Create a Type that takes "Free form text" (I usually call it "Any"), by creating a type and selecting this for "What kind of values" will it support.

    Any Intent

    1. Create an Intent where all the sample phrases use this Any type - I've named it "fallback" in this example. You should specify that this is not a global Intent, since we only want it explicitly triggered in a Scene. Then create an intent parameter that uses the Any type and some sample phrases that use this parameter. Make sure you highlight some of the words in the phrases to show which parts are the "Any" type, since they won't automatically match.

    fallback intent

    1. Finally, in your scene, place this as the last Custom Intent. (Note that it must be the last Custom Intent, since they are evaluated in order.) You can then assign it to transition to whatever scene you want.

    scene