Google Sheets
Add a bot to Google Sheets using the official integration.
The Google Sheets integration allows your bot to access and update Google Sheets data in real-time, automating tasks like CRM updates, inventory management, and survey tracking directly within chat.
Setup
You will need:
For more advanced use cases, you can manually configure the integration using a service account.
You will need:
- A published bot
- A Google account
- Access to Google Cloud Console
Step 1: Create a Google Cloud project
Go to the Google Cloud Console and sign in with your Google account.
Step 2: Enable the Google Sheets API
Step 3: Create a service account
The downloaded JSON file contains sensitive credentials. Store it securely and never share it publicly. The file structure looks like this:
{
"type": "service_account",
"project_id": "your-project-id",
"private_key_id": "...",
"private_key": "...",
"client_email": "your-service-account@your-project.iam.gserviceaccount.com",
"client_id": "...",
"auth_uri": "...",
"token_uri": "...",
"auth_provider_x509_cert_url": "...",
"client_x509_cert_url": "...",
"universe_domain": "googleapis.com"
} Step 4: Grant spreadsheet access to the service account
Step 5: Configure the integration in Botpress
Fill in the integration’s configuration fields:
Spreadsheet ID
Spreadsheet ID
- Open your Google Sheets spreadsheet in your browser.
- Copy the ID from the URL. The ID is the string between
/d/and/editin the URL.
For example, if your URL is https://docs.google.com/spreadsheets/d/1AbCdEfGhIjKlMnOpQrStUvWxYz/edit, the Spreadsheet ID is 1AbCdEfGhIjKlMnOpQrStUvWxYz.
Client Email
Client Email
Open the JSON file you downloaded in Step 3 and copy the client_email value.
Private Key
Private Key
Open the JSON file you downloaded in Step 3 and copy the entire private_key value, including the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- markers.
When you’ve filled in all the fields, select Save Configuration.
You’ve successfully configured the Google Sheets integration!
Cards
Add Sheet
Adds a new sheet to the spreadsheet.
inputobjectoutputobjectAppend Values
Appends values to the spreadsheet. The input startColumn is used to search for existing data and find a "table" within that range. Values will be appended to the next row of the table, starting with the first column of the table.
inputobjectoutputobjectClear Values
Clears values from a spreadsheet. Only values are cleared; all other properties of the cell (such as formatting, data validation, etc..) are kept.
inputobjectoutputobjectCreate Named Range in Sheet
Creates a named range in a sheet.
inputobjectoutputobjectDelete Rows
Delete one or more rows by their 1-based indexes. Rows are deleted in reverse order to preserve indexes during deletion.
inputobjectoutputobjectDelete Sheet
Deletes a sheet from the spreadsheet.
inputobjectFind Row (First Match)
Search for the first row where a specific column matches a value. Returns the row data and its index, or null if no match is found.
inputobjectoutputobjectFind Rows
Search for rows where a specific column matches a value. Returns all matching rows with their indexes. Handles empty sheets and no matches gracefully by returning an empty array.
inputobjectoutputobjectGet All Sheets in Spreadsheet
Returns all sheets in the spreadsheet.
outputobjectGet Info of a SpreadSheet
Returns the properties and metadata of the specified spreadsheet.
inputobjectoutputobjectGet Named Ranges
Returns all named ranges in the spreadsheet.
outputobjectGet Protected Ranges
Returns all protected ranges in the spreadsheet.
outputobjectGet Row
Fetch a specific row by its 1-based index. Provides direct row access without A1 notation math.
inputobjectoutputobjectGet Values
Returns the values of a range in the spreadsheet.
inputobjectoutputobjectInsert Row at Index
Insert a new row at a specific 1-based index. Existing rows at and below the index are shifted down.
inputobjectoutputobjectMove Sheet Horizontally
Moves a sheet to a new index in the spreadsheet.
inputobjectProtect Named Range
Creates a protected range from a named range, preventing modification.
inputobjectoutputobjectRename Sheet
Renames a sheet in the spreadsheet.
inputobjectSet Sheet Visibility
Sets the visibility of a sheet in the spreadsheet.
inputobjectSet Values
Sets values in a range in the spreadsheet.
inputobjectoutputobjectUnprotect Range
Removes protection from a protected range in the spreadsheet.
inputobjectUpdate Row
Update a specific row by its 1-based index with a partial or complete set of values. Only the provided values are updated.
inputobjectoutputobjectUpsert Row
Update a row if it exists (based on a key column match), or append a new row if no match is found. Useful for maintaining unique records.
inputobjectoutputobjectTriggers
For Cards that take named ranges as input, Google’s standard restrictions for range names apply. Range names:
- Can contain only letters, numbers, and underscores
- Can’t start with a number, or the words “true” or “false”
- Can’t contain any spaces or punctuation
- Must be 1–250 characters
- Can’t be in either A1 or R1C1 syntax. For example, you might get an error if you give your range a name like
A1:B2orR1C1:R2C2