> For the complete documentation index, see [llms.txt](https://helpdocumentation.gitbook.io/user-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helpdocumentation.gitbook.io/user-documentation/bot-builder/whatsapp-chatbot/google-sheet-blocks/google-sheets-data-search-via-bot-flow.md).

# Google Sheets Data Search via Bot Flow

This feature allows you to fetch data from Google Sheets and respond to users dynamically in a bot flow.\
Steps:

1. Go to **Chatbot** and click on **Create Bot Flow**
2. Enter a **Bot Flow name**
3. Add a **Trigger** (e.g., Keyword) and select channel
4. Add an **Ask Question** block to collect input (e.g., Complaint Number)
5. (Optional) Save response in a **Custom/Super Field**
6. Add a **Branch** and select **Automation App → Google Sheets**
7. Choose **Lookup Spreadsheet Rows** action
8. Connect your Google account (Authentication)
9. Select **Spreadsheet** and **Sheet**
10. Enter **Column** (e.g., D for Complaint Number)
11. Set condition (e.g., Equal to Number) and map value as **Last Text Input**
12. Test and verify data using **Run History**
13. Save response data into **Bot Fields** (e.g., Status, Row Count)
14. Add a **Router**:

* If no record → send “No record found” and re-ask input
* If record found → display fetched data

15. Save and **Enable Bot Flow**

This setup helps automate data lookup and gives instant responses to users using Google Sheets.

{% embed url="<https://www.youtube.com/watch?v=uv5_hBemflk>" %}


---

# 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://helpdocumentation.gitbook.io/user-documentation/bot-builder/whatsapp-chatbot/google-sheet-blocks/google-sheets-data-search-via-bot-flow.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.
