[SOLVED] Combining buttons with intents?

Hi there–

I think I may have a foundational misunderstanding of how to compose intent “listeners” & buttons on the canvas.

Toy scenario

I have a simple agent which can currently do 2 things when the user utters a phrase

(1) show Admin information based on user input (ex “I need to request an absence” or “I need help with setting up my machine”)

(2) show Games information based on user input (ex. “Games”, “Let’s play a game”, “Show me games”)

I also want to be able to let users tap a button and access Admin or Games information without typing anything

What’s working:

I made 2 intents and users can type a problem an access the correct block. This is done using a Choice Block that triggers intents and which in turn access Admin or Games resources based on the user’s input

ex. Lovely demo–
agent_demo

What’s unclear:

I can’t figure out how to also give my user a button to access Admin/Games info in addition to allowing them to enter natural language (ie trigger intent)

I can definitely use buttons by using the “Select a Block” Action

But what I really want is to let my user tap that button OR enter one of the trigger phrases

I found out how to attach intents to buttons with the settings cog below ex.

attach_intents

Unclear: How to trigger an intent based on a button click

Put simply, I want a user to be able to enter a trigger phrase OR tap a button.

I’ve seen in some screenshots an “Attach Intent” option but it doesn’t appear as an option on my canvas

I think I need to rethink the structure of my agent, but I’m curious if there is a proper way to accomplish this

Resources

Update-- not sure if this is the “right” way to do it, but I was able to accomplish my goal with the following

  • In the button step tap the config icon and select Add Intents for Buttons

  • Then for each button you want select, there will be a new “Attach Intent” option where you can select the intent you want

attach_intents_working

  • Then you can reach the target via button tap or entering an utterance upon which the intent was trained, ex

Demo:
button_intent_demo

Update: In order to programmatically “click” a button attached to an intent w/ Dialog Manager you can use (1) intent type or (2) the button’s text

Using type “intent”

{
	"action": {
		"type": "intent",
		"payload": {
			"intent": "Admin"
		}
	}
}

Using type “text”

{
	"action": {
		"type": "text",
		"payload": "Admin"
	}
}

Using “path” (not applicable here)

Note: this only comes from a button block

{
     "action": {
          "type": "path-erm34gu"
     }
}

*Intent payload requires name key:

{
	"action": {
		"type": "intent",
		"payload": {
			"intent":  { "name": "Admin" }
		}
	}
}