# Query a Google Sheet

Our platform lets you read a write to a google sheet directly.&#x20;

{% hint style="info" %}
Please note it works with only with Google Sheets, and not xlsx files hosted on google
{% endhint %}

#### Package

```
const sheets = require("@googlesheets");
```

#### Reading a sheet

{% hint style="info" %}
To allow reading from a google sheet, please write to <support@konverse.ai>, to get email ID of the chatbot to which you will need to grant permissions
{% endhint %}

```
let rows = await sheets.readSheet(workBookId, sheetId)
rows.map(row => {
  let first_name = row["First Name"]
});
```

| Parameter  | Description                                                                           |
| ---------- | ------------------------------------------------------------------------------------- |
| workbookID | The ID of the google sheet, from its URL                                              |
| sheetID    | Index of your sheet starting from 0. To read first sheet in your google sheet, pass 0 |

#### Append a row in google sheet

```
let sheet = await sheets.getSheet(workbookID, sheetID);
const larryRow = await sheet.addRow({ name: 'Larry Page', email: 'larry@google.com' });
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.konverse.ai/platform/embedded-functions/query-a-google-sheet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
