# Google-таблицы

{% hint style="info" %}
You can interact with your google-sheets through the bot: enter information (in rows and cells), as well as retrieve it. You will need a google account.&#x20;
{% endhint %}

Let's create a suitable action by selecting "Google Spreadsheet" integration from the left additional menu or by right-clicking in an empty area of ​​the screen. Please note that "Actions" and "Integrations" are separate sections.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F95T5HHTaGo2lDoAR0FCX%2F1.png?alt=media\&token=11e9d3e5-dec5-4c82-859f-45751d3001ef)

## Linking an account

When we select the desired operation, a block will appear in the center of the screen, and its menu will open on the right. Click on the authorization button to link your Google account to Smartbot Pro.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F6DgwPa1tOoDVPSA3qOec%2F2.png?alt=media\&token=9a7159af-2267-4a33-9f65-7f0939b9e4a3)

First, you will be prompted to select the desired account.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FO0xHAjklHKbrjIHs8fdO%2F3.png?alt=media\&token=20e4cab9-4ee6-4a32-b360-8eff89b10857)

First, you will be prompted to select the desired account.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FG5qHGs6g9vltyvIs89iw%2F4.png?alt=media\&token=e2a8fa68-1722-4060-9952-04329cff1005)

If everything went well, you will see this inscription.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FdxlbO6C1D5PWY8MGpr9h%2F5.png?alt=media\&token=dc68e03a-d678-4586-8ab0-b84f895cbc6f)

You can close the tab with it.&#x20;

Let's go to the Google account to create a table and make it available to our bot.&#x20;

Open the account menu in the upper right corner, scroll down a little and select tables.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fj4ShHxOU8q41wxOBnwsv%2F6.png?alt=media\&token=6459cd8b-d485-4fa2-9fff-7b2f603dd941)

You can then select an existing table or create a new one.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F600Oh4G1OBmopggVUVZe%2F7.png?alt=media\&token=5274f002-8249-45b2-953c-ddc115f92ae5)

Click on "Access Settings":

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Fo1WZdXHcQahjJHrAGRCz%2F8.png?alt=media\&token=30d2996e-00ea-4998-bd7b-a717970abe3d)

Let's open access to the table by reference. After that, copy it and paste it into our bot.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F2JUVZ1sJJHIkjNWUnjc7%2F9.png?alt=media\&token=bf6cedb4-b634-4422-8a4e-961a1d994bd6)

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2F5xhVqwV60gMatuKVIu9G%2F10.png?alt=media\&token=804fccec-3146-4ac3-99d2-034c7a098aa3)

## Adding a row to a table

We return to the settings of the Smartbot Pro script, to the Google Tables block.&#x20;

Paste the copied link and hit enter.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FnQPhyEoELj27Cmz6oa0k%2F11.png?alt=media\&token=7d3cb8c4-ce0c-4c90-8d2d-d617e7912eed)

New fields will appear.&#x20;

In the case of writing to a table, this will be the choice of a sheet and variables for cells

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FrUtcJTCW4hhmu5gNjWzY%2F12.png?alt=media\&token=158bf6f7-04bd-41d2-b5d7-75f5b6c37b9b)

Now let's make a simple chain: the user writes "Hello", the bot answers and enters the user's data into the table.

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FSqld7LP9Zz6hu9uBefeK%2F13.png?alt=media\&token=cb18b79d-1568-4999-8c8e-d1245bf2fa63)

![Пишем приветствие в Telegram](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2Ff1djhJMlI1kYPV52VThc%2F14.png?alt=media\&token=947596a1-3251-43ae-940c-7e27b02539a5)

![Бот вносит в таблицу указанные переменные: тип канала и id пользователя](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FHhPMyrQJ4AtneVe3h527%2F15.png?alt=media\&token=26b501ac-fc18-4543-ba1e-ef7451d465c7)

## Getting data from a table

Getting data from a table works similarly. We insert a link to the table, select which cell (or range of cells) to read the data from, and indicate in which variable to write this information (in string format).

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FRzE0YRPNWnYobP7VJPB1%2F16.png?alt=media\&token=c3d83529-5638-40dc-a6c3-a87e77b458fa)

With the integration with Google Sheets, you can store all the necessary data (for example, phone numbers, addresses, and other information about orders) in one place.&#x20;

Now you know how to use tables in Smartbot Pro!
