ROODAY
ROODAY

Reputation: 832

How to persist a parameter in dialogflow throughout a session?

My organization is setting up a chatbot to help handle simple problems, and we'd like to differentiate answers depending on the user. For some questions, depending on whether the user is a student, faculty, or staff may change the answer (whether or not the request is allowed/access/etc.).

Within Dialogflow I set up an entity called @Affiliation to capture "student", "faculty", or "staff" but now the problem is how do I access that entity in other intents? Is it possible to store that entity somewhere in the session or context such that other intents can read the value and change their response?

Upvotes: 1

Views: 580

Answers (1)

Prisoner
Prisoner

Reputation: 50701

The general approach for this would be to store any values you want to store between turns in the conversation as a parameter in an Output Context. You should set the lifespan for this to a large number, 99 is typical, or re-set this as the Output Context each time.

Then, you can read the parameter in the named Context when you need the information.

Upvotes: 2

Related Questions