Setting a slot value based on the previous question asked

Hi,

I am trying to create a story with 5 questions, in which user might say general answers like “Nothing” apart from specific intent. I want to know if we can use custom actions and set a slot value using trackers based on the question which has been asked, so that we can train the bot to respond with general intents like “Nothing” for each question.

Hello, I think the above question is not clear. Let me reframe the question:

Suppose I have a set of three questions?

  1. Q1 User : Nothing

  2. Q2 User : Nothing

  3. Q3 User : Nothing

How can I differentiate between first and second question and run the flow forward. Any help is greatly appreciated. Thanks!

set “Nothing” as specified intent, and create your action to handle the intent of “Nothing” in terms of last bot’s question.

My problem is that how can we access the last bot question using tracker?

@akelad Can you look please look into this once ? Thanks.

I’m not sure what you mean with the user saying “Nothing”?

In my flow, there is a sub question “Any specific thing you want to mention?” for each question and user can say “Nothing” and should go ahead to the next question.

you could just have a deny intent, and write a story based on that, there doesn’t need to be entities present.

Yes we can do that, but I was thinking if one can access the previous actions from tracker and can set the slot values based on that in custom actions, there might be more use cases for this.

I mean you can access the latest_action from the tracker, with tracker.latest_action, but setting slot values based on previous actions is something you can just handle with stories too

Fine. I will try using stories. Thanks a lot :slight_smile: .