Fez Vrasta
Fez Vrasta

Reputation: 14835

Trigger different follow-up intent based on user reply?

I'm trying to create a bot that should allow this kind of interaction:

(U = user, B = bot)

Case A:

Case B:

So, I need to trigger a different question depending by what the user told me in the first interaction.

Right now I properly get the type of analysis (XXX or YYY), but I can't figure out how to trigger a different follow-up intent depending by the type value.

What's the proper way to do it?

I was counting to write the bot using Node.js so if the answer requires to write a backend please I'd like to get referenced to the Node.js docs and resources.

Upvotes: 1

Views: 661

Answers (1)

Prisoner
Prisoner

Reputation: 50741

First of all, remember that intents are triggered based on what the user does. You don't "trigger" an intent, your users do. How you process that intent is based on the intent triggered as well as other state you may have about the conversation - in this case, the analysis type. See this StackOverflow answer and the related medium article (and followup articles) that discuss how to handle this.

If you want to ask something different based on how the user replied - use your webhook fulfillment to ask something different. Responses aren't based on Intents. You don't need to "trigger" anything.

Sometimes you want only certain intents to be triggered based on state. In these cases, you can set a Context and limit Intents to be fired only when the Input Contexts are all present.

Upvotes: 1

Related Questions