# Google Sheets

Push and fetch records from a Google Sheet.

Available in the **STARTER** plan and above.

Using the Google Sheets integration, you can perform two actions – i.e., create a record or fetch data from your desired Google Sheets.

### Connecting your Google account <a href="#connecting-your-google-account" id="connecting-your-google-account"></a>

Before using this action block, you need to connect your Google account. Once connected, you will see the list of all Google Sheets that you have edit access to.

You can connect your account in two ways:

1. Google Sheets action block – Click on the “+ Add account” option.
2. App market – Click on Google Sheets > Sign in with Google

Once connected, you will see your Google email address in the account dropdown.

Ensure to grant all the necessary permissions on the account permission screen.

### Creating records <a href="#creating-records" id="creating-records"></a>

To create a record on Google Sheets, here are the steps to be followed:

#### Step 1: Choose your Google Sheet <a href="#step-1-choose-your-google-sheet" id="step-1-choose-your-google-sheet"></a>

After choosing your Google account, and action as “Create records”, you need to choose your desired “Sheet” from the dropdown.

You will only see the sheets that you have edit access to. And when choosing a sheet, wotSABot automatically creates a new worksheet under which the data will be pushed.

#### Step 2: Choose the variables you want to send <a href="#step-2-choose-the-variables-you-want-to-send" id="step-2-choose-the-variables-you-want-to-send"></a>

Now choose the variables that you want to push to the selected Google Sheet. Each selected variable will be added as a column on the sheet.

For example, if you want to push lead information you would select the following variables:

* Name
* Email
* Phone
* City
* Country
* Created at

### Fetching records <a href="#fetching-records" id="fetching-records"></a>

You can fetch data from a Google Sheet based on criteria using this action.

#### Step 1: Choose the sheet to search <a href="#step-1-choose-the-sheet-to-search" id="step-1-choose-the-sheet-to-search"></a>

Choose the Google sheet and the worksheet that you want to search data from.

Enable the checkbox ‘First row contains..’ if the column heading is present.

#### Step 2: Add your search criteria <a href="#step-2-add-your-search-criteria" id="step-2-add-your-search-criteria"></a>

Define the search criteria based on which values will be fetched from the Google Sheet.

You can choose to add multiple conditions using the “ANY/ALL” operators.

For example, you want to fetch the leads whose city is New York and country is United States.

* Condition 1: Column=city, Operator=equals to, Value=New York
* Condition 2: Column=country, Operator=equals to, Value=United States
* Choose the ALL operator, as you need both conditions to hold true.

#### Step 3: Saving responses <a href="#step-3-saving-responses" id="step-3-saving-responses"></a>

Choose the values from the columns you want to save into variables. Map them out, and the values fetched will be stored inside.

If more than one row gets qualified in the search criteria, the data will be stored in a JSON format in the variable. You can then use the dynamic data action block to parse the data.

For example, if we choose the above condition of city=New York and country=United States, we will receive multiple records as a response.

Taking the example of the name field, it would be stored as:

Copy

```
[{“name”: “Hardik Makadia”, “name”: “John Doe”}]
```


---

# 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://help.wotsabot.ai/wotsabot-help-articles/integrations/ready-integrations/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.
