Accessing botpress state in actions

Hello,

The flow of my bot goes as such:

  1. The user will specify the type of documents that they want.
  2. The bot will retrieve the amount of documents first.
  3. The bot will then request the user a yes/no answer f they wish a link to the various documents.
  4. If the user specifies “yes”, the bot will sent the links.

Currently, I am able to save the state of the type of documents requested using setVariable for the session. However, I am not sure how to access the state for my function between 3 and 4.

Solved by figuring out that it was accessible by session.name. That took a while, especially coming from React. :slight_smile:

Hello, Can you share a screenshot of how you did it?

@kenkaigu Inside your action, you can access the variables like that: