Read Google Table
Google Sheets integration with bot: using information from table and instructions for working with "Read Google Table" block
The Google Table reading block allows you to read data from Google Sheets, filter them by certain conditions, save results in variables and output them to the bot. 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 Google Table reading block to the scenario
- In the created block, paste the previously copied document url in the url field and select the Sheet from which reading will be performed
- 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 after the header
- Add filters by specifying columns by which rows will be filtered, by what conditions, and what they will be compared with.
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
- If the result needs to be sorted, then in the "Sorting" section specify the columns by which this should be done
- If you need to save the found values in variables, you can do this in the "Set Variables from Column Values" section. On the left, specify the column from which the value should be saved, on the right - the variable in which this value should be written.
If multiple rows are found, values from the first found row will be written to variables 10. Next, if you need to output the values found in the table to the bot, you need to configure the "Message Chain Template"
.png)
In the example in the picture, instead of `{{A}}` the value from column A will be substituted, and instead of `{{B}}` the value from column B will be substituted.
If you need to output a picture or file to the bot, the url to which is in the table, you need to click on the "Photo" or "File" button and specify in which column the url is located.
- Then you need to specify how many found rows will be output to the bot (from 1 to 100)
- Next, if necessary, add buttons in the Menu section
Complete guide to integration and working with Google Sheets data in chat bots
Video with a breakdown of the "Read Google Table" block functionality.
Setting up integration with Google Sheets, creating filters for data search, saving values in variables and outputting information to chat bot.
The video demonstrates creating a system with record pagination, setting up text and image output templates, as well as advanced filtering capabilities by various conditions.
In the LEADTEX personal account, 250+ lessons on chat bot and MiniApp development are already available, as well as the opportunity to join the largest no-code developer community with 6000+ participants - Go to personal account.
.png)
.png)
.png)
.png)