we.are
we.are

Reputation: 427

How to make a while loop by dialogflow intents?

I have the following intent and followup intents for a user login process:

Pic1

Pic0

Pic2

Pic3

Pic4

How can I set a while loop for this login process in order to continue asking user email while user enters email address incorrectly and after he/she enters it correctly the getting password intent triggers? In my cases after 2 incorrect entry, api.ai will response "Not Available".

Upvotes: 1

Views: 3141

Answers (1)

mattcarrollcode
mattcarrollcode

Reputation: 3479

Forcing users to respond to a question without giving them recourse to cancel, move to another part of your conversational interface or speak about another subject is user-hostile and I'd recommend doing exactly what Actions on Google forces you to do in this situation: end the conversation after a few failed attempts.

Conversational interfaces are best thought of as designing actual conversations. In a normal conversation asking the same question multiple times regardless of what someones says to you would largely be considered annoying at best. Consider revising your Dialogflow agent to allow logged-out conversations explaining to the user what your agent can offer and why login is required for certain features. If the user repeatedly asks for a feature that requires login but refuses to do so, the conversation should end.

Another note here: I'd recommend against using passwords through conversational interfaces. Most conversational platforms have a way to sign in (e.g. Google Assistant/Actions on Google) or you can safely assume the user is using a device where they have access to a web browser as well (Slack) and you can use a system like OAuth to properly authenticate users.

Upvotes: 1

Related Questions