> For the complete documentation index, see [llms.txt](https://docs.chatlayer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chatlayer.ai/buildabot/tips-and-best-practices/go-to-previous-bot-dialog.md).

# Go to previous block

Usually, when a user asks a question, and this is not understood, they see a message like 'I did not understand'. To refresh the user's memory, you can repeat the last block again to the user, as shown below:

![](https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLTwFwbOqJj4dDhg8Ju%2F-MX1uvBXpHgAPXxjW-Li%2F-MX2PScKajnYaSgwAVAE%2Fimage.png?alt=media\&token=7b593cb6-038d-496e-8f85-844ef9ce018f)

What we see here is that the introduction has been created, and then the bot does not understand the user input 'test'. Then, after the 'not understood' message, the same message from before is shown again. This creates a full user experience and conversation flow. How to set this up is explained below:

## 1. Add variable to 'not understood'

In the 'not understood' bot message, create a new variable as shown below:

![](https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLTwFwbOqJj4dDhg8Ju%2F-MX1uvBXpHgAPXxjW-Li%2F-MX2PwV-U1Bfu4lym7xE%2Fimage.png?alt=media\&token=03338377-a9f1-4d3e-83f9-4312ec50d043)

Also make sure that the 'Go to' section of this block goes to a new Action block, called 'Go to previous block' in this case.

## 2. Create an Action block

In the 'Go to previous block' action, create the following:

![](https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLTwFwbOqJj4dDhg8Ju%2F-MX1uvBXpHgAPXxjW-Li%2F-MX2QEhKU8uI3RoDGtw2%2Fimage.png?alt=media\&token=f1e650c8-4f5f-4a26-890d-b52202e57853)

This makes sure that the bot goes to the previous block, using the variable that is set in the 'not understood' bot message. The code can be copied from below:

```javascript
const { prevDialog } = args;

ChatlayerResponseBuilder()
.setNextDialogState(args.prevDialog)
.send() 
```

Make sure to test out your new configuration in the emulator.

And that's it! With just two simple steps you have created a better 'not understood experience'. Make sure to also check out the other [articles ](https://docs.chatlayer.ai/tips-and-best-practices/not-understood-bot-dialog)written about the 'not understood' block.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chatlayer.ai/buildabot/tips-and-best-practices/go-to-previous-bot-dialog.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
