# Updating Google Sheets

*Note: Currently, only inserts are supported so we only can append to existing sheets.*

### Step 1: Give A Key Permissions to your sheet

![](/files/-MXY8axJtRGxYHGREljq)

![](/files/-MXY4TfHYcEzpESliiAm)

### Step 2: Give the service account edit permissions to your sheet

After that, the last step is to give UseSQL's service account, `googlesheets@usesql.iam.gserviceaccount.com`, editor access to your Google Sheet.

![](/files/-MYlamWsVRzXQjcudWZ9)

### Step 3: Start inserting your data

After you have done those two things you are ready to query your Google Sheet. UseSQL uses the SQLite query syntax so it may be useful to take a look at their [INSERT](https://sqlite.org/lang_insert.html) documentation. Below is an example of inserting three values into the category column. So for a Google Sheet like the following.

![](/files/-MYlYahGvKxuaZBZ3RNJ)

We could append additional categories as shown below.

`INSERT INTO "https://docs.google.com/spreadsheets/d/11IYmdNXfaDzdL2mErTqMjE_6NqEqpKxw6YPdXiyCMZ2/edit#gid=337090280" (category) VALUES ('Horror'), ('Sci-Fi'), ('Thriller')`

If you had an API key that has access to the following sheet you would be be able to trigger the query that you can view in the demo sandbox below.

[\[Sandbox Example\]](https://www.usesql.com/demo?query=INSERT%20INTO%20%22https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F11IYmdNXfaDzdL2mErTqMjE_6NqEqpKxw6YPdXiyCMZ2%2Fedit%23gid%3D337090280%22%20\(category\)%20VALUES%20\(%27Horror%27\)%2C%20\(%27Sci-Fi%27\)%2C%20\(%27Thriller%27\)\&format=html)


---

# 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://docs.usesql.com/tutorials/inserting-into-google-sheets.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.
