Write to Google Table
Google Sheets integration with bot: writing information to Google table and instructions for working with "Write to Google Table" block
The Write to Google Table block allows you to add or update existing data by a given filter from variables and constants in an existing Google table.
For this you need to:
- Create a "Google Spread Sheets" file in your Google account. Note that the file must be of this type. A file with Microsoft Excel (xlsx) type is not supported
- Open the table in the browser and copy its entire url, as shown in the picture
.png)
- Perform integration with Google Sheets, as described in the section Google Sheets integration
- Add a "Write to Google Table" block to the scenario
 (1).png)
- In the created block, paste the previously copied document url in the url field and select the Sheet into which writing will be performed
.png)
- Specify from which row the search will be performed. For example, if your first row is a header, specify the value "2" so that the search starts from the next row after the header
- Select the block operation mode
The block can work in 3 modes:
- "Add Record" - Adds a record to the end of the list
- "Update Records" - Performs a search by the specified filter (in the "Set Filters for Search" field group) and updates all rows matching the filter conditions.
-
"Update + Add Record" - Combines 2 modes: -- first execution goes in "Update Records" mode, -- if the record is not found, execution goes in "Add Record" mode.
-
In the "Set Filters for Search" group, set the criteria for selecting records that you want to update. If you don't need to update existing records, but need to add a new record, don't set filters and select the "Add Record" operation mode.
The following conditions can be applied:
- "=" — strict equality comparison. Only rows equal to the specified will be included in the selection
- "!=" — inequality comparison. Only rows not equal to the specified will be included in the selection
- ">" — greater than comparison. Only rows greater than the specified will be included in the selection
- ">=" — greater than or equal comparison. Only rows greater than or equal to the specified will be included in the selection
- "<" — less than comparison. Only rows less than the specified will be included in the selection
- "<=" — less than or equal comparison. Only rows less than or equal to the specified will be included in the selection
- "in" — string inclusion comparison. Only rows that contain the specified value will be included in the selection
-
"not in" — string non-inclusion comparison. Only rows that do not contain the specified value will be included in the selection
-
In the "Data to Write to Google Table" group, specify the relationships of the data to be written with the table columns.
For correct addition of a record to the end of the table, its leftmost column must contain data.
If the row to be written needs to be assigned a unique identifier, click "Add Unique Identifier" and specify the column into which it should be written.
🎁 Free course on chat bot and MiniApp development for all users with active PRO subscription is already available on LEADTEX. 10 detailed lessons with immersion FROM A to Z.
Start learning right now - Start learning.
.png)
.png)