Google Sheets
Read, write, and manage data in Google Sheets spreadsheets.
On this page
- Connect
- Call it from a workflow
- Actions (21)
- clear_sheet
- find_rows
- insert_row
- update_row
- copy-worksheet
- create-column
- create-spreadsheet
- create-worksheet
- custom_api_call
- delete_row
- delete-worksheet
- export_sheet
- find_row_by_num
- find_spreadsheets
- find-worksheet
- format-row
- get_next_rows
- get-many-rows
- google-sheets-insert-multiple-rows
- rename-worksheet
- update-multiple-rows
- Details
Connect
Auth type: OAuth (oauth2). The connection holds the provider's OAuth tokens. They are sealed on the server and only opened when an action runs.
Scopes requested: https://www.googleapis.com/auth/spreadsheets
- From your agent: integrations {action: "connect", piece, credentials, env} stores the credentials for dev, prod or all. Answers name the fields, never the values.
- Or set the integration's project secrets with the secrets tool (SLACK_BOT_TOKEN, DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN …): a call uses the connection, else those secrets. integrations {action: "catalog", piece} lists which ones work.
- Try one action now with integrations {action: "call", piece, piece_action, input}. It really sends.
Call it from a workflow
step.ctx.integrations.invoke("google_sheets", action, input) resolves with the provider's answer and rejects when Google Sheets isn't connected or refuses. Wrap it in step.run so a retry sends once. See step.ctx. Its actions run through the integration runner, which the server's operator turns on: integrations {action: "catalog", piece: "google_sheets"} says whether yours can call it.
// workflows/notify.ts: call Google Sheets when a booking is confirmed
import { on } from "@appbricx/workflows";
export const tellGoogleSheets = on.transition("booking", "status", "confirmed", async (_event, step) => {
// Recorded once: a retry doesn't send it twice. Rejects when Google Sheets isn't connected.
const output = await step.run("Google Sheets", () =>
step.ctx.integrations.invoke("google_sheets", "clear_sheet", {
"spreadsheetId": "<spreadsheetId>",
"sheetId": "<sheetId>",
"is_first_row_headers": true,
"headerRow": 1
}),
);
step.ctx.log("Google Sheets answered", output);
});{
"name": "integrations",
"arguments": {
"project_id": "<project-id>",
"action": "call",
"piece": "google_sheets",
"piece_action": "clear_sheet",
"input": {
"spreadsheetId": "<spreadsheetId>",
"sheetId": "<sheetId>",
"is_first_row_headers": true,
"headerRow": 1
},
"env": "dev"
}
}curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/google_sheets/clear_sheet" \
-H "Authorization: Bearer $APP_KEY" \
-H "content-type: application/json" \
-d '{"props":{"spreadsheetId":"<spreadsheetId>","sheetId":"<sheetId>","is_first_row_headers":true,"headerRow":1}}'Actions
clear_sheet
Clear Sheet. Clears all rows on an existing sheet.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | The ID of the spreadsheet to use. |
sheetIdrequired | id (picked from your account) | The ID of the worksheet to use. |
is_first_row_headersrequired | boolean | First Row Contains Headers ? |
headerRowrequired | number | Enter the row number where your column headers are located (usually row 1). |
find_rows
Find Rows. Look up rows in a worksheet based on a column value.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | The ID of the spreadsheet to use. |
sheetIdrequired | id (picked from your account) | The ID of the worksheet to use. |
columnNamerequired | id (picked from your account) | The name of the column to search in |
searchValueoptional | text | The value to look for in the selected column. Leave empty to return all rows. |
matchCaserequired | boolean | Only return rows where the cell value exactly matches the search value. |
startingRowoptional | number | Start searching from this row number. |
numberOfRowsoptional | number | How many rows to return. Defaults to 1 if not specified. |
headerRowrequired | number | The row number that contains the column names. |
useHeaderNamesoptional | boolean | Use column names as keys instead of A, B, C. |
insert_row
Add Row. Add a new row of data to a specific spreadsheet.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | The ID of the spreadsheet to use. |
sheetIdrequired | id (picked from your account) | The ID of the worksheet to use. |
first_row_headersrequired | boolean | First Row Contains Headers ? |
as_stringoptional | boolean | Inserted values that are dates and formulas will be entered strings and have no effect |
valuesrequired | object (depends on other props) | The values to add |
update_row
Update Row. Update the data in an existing row.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | The ID of the spreadsheet to use. |
sheetIdrequired | id (picked from your account) | The ID of the worksheet to use. |
row_idrequired | number | The row number to update |
first_row_headersrequired | boolean | First Row Contains Headers ? |
valuesrequired | object (depends on other props) | The values to add |
copy-worksheet
Copy Worksheet. Creates a new worksheet by copying an existing one.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | Spreadsheet Containing the Worksheet to Copy |
sheetIdrequired | id (picked from your account) | Worksheet to Copy |
desinationSpeadsheetIdrequired | id (picked from your account) | Spreadsheet to paste in |
create-column
Create Spreadsheet Column. Creates a new column in a specific spreadsheet.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | The ID of the spreadsheet to use. |
sheetIdrequired | id (picked from your account) | The ID of the worksheet to use. |
columnNamerequired | text | Column Name |
columnIndexoptional | number | The column index starts from 1.For example, if you want to add a column to the third column, enter 3.Ff the input is less than 1 the column will be added after the last current column. |
create-spreadsheet
Create Spreadsheet. Creates a blank spreadsheet.
| Input | Type | Description |
|---|---|---|
titlerequired | text | The title of the new spreadsheet. |
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
folderoptional | id (picked from your account) | The folder to create the worksheet in.By default, the new worksheet is created in the root folder of drive. |
create-worksheet
Create Worksheet. Create a new blank worksheet with a title.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | Spreadsheet |
titlerequired | text | The title of the new worksheet. |
headersoptional | array | Headers |
custom_api_call
Custom API Call. Make a custom API call to a specific endpoint
| Input | Type | Description |
|---|---|---|
urlrequired | object (depends on other props) | url |
methodrequired | one of "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD" | Method |
headersrequired | object | Authorization headers are injected automatically from your connection. |
queryParamsrequired | object | Query Parameters |
body_typeoptional | one of "none" | "json" | "form_data" | "raw" | Body Type |
bodyoptional | object (depends on other props) | Body |
response_is_binaryoptional | boolean | Enable for files like PDFs, images, etc. |
failsafeoptional | boolean | No Error on Failure |
timeoutoptional | number | Timeout (in seconds) |
followRedirectsoptional | boolean | Follow redirects |
delete_row
Delete Row. Delete a specific row from the selected sheet.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | The ID of the spreadsheet to use. |
sheetIdrequired | id (picked from your account) | The ID of the worksheet to use. |
rowIdrequired | number | The number of the row you want to delete. |
delete-worksheet
Delete Worksheet. Permanently delete a specific worksheet.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | The ID of the spreadsheet to use. |
sheetIdrequired | id (picked from your account) | The ID of the worksheet to delete. |
export_sheet
Export Worksheet. Download a worksheet as a CSV or TSV file.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | The ID of the spreadsheet to use. |
sheetIdrequired | id (picked from your account) | The ID of the worksheet to use. |
formatrequired | one of "csv" | "tsv" | Select the file type to export the sheet as. |
returnAsTextoptional | boolean | Return the exported data as text instead of a file. |
find_row_by_num
Get Single Row by ID. Retrieve a specific row using its unique ID.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | The ID of the spreadsheet to use. |
sheetIdrequired | id (picked from your account) | The ID of the worksheet to use. |
rowNumberrequired | number | Enter the row number you want to retrieve |
headerRowrequired | number | Enter the row number where your column headers are located (usually row 1). |
find_spreadsheets
Find Spreadsheet(s). Find spreadsheet(s) by name.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheet_namerequired | text | Enter the name of the spreadsheet to search for |
exact_matchoptional | boolean | If true, only return spreadsheets that exactly match the name. If false, return spreadsheets that contain the name. |
find-worksheet
Find Worksheet(s). Finds a worksheet(s) by title.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | Spreadsheet |
titlerequired | text | Title |
exact_matchoptional | boolean | If true, only return worksheets that exactly match the name. If false, return worksheets that contain the name. |
format-row
Format Row(s). Format one or multiple rows in specific spreadsheet.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | The ID of the spreadsheet to use. |
sheetIdrequired | id (picked from your account) | The ID of the worksheet to use. |
startingRowrequired | number | The first row number where formatting should begin. |
endingRowoptional | number | The last row number where formatting should stop (leave empty to format only the starting row). |
bgColoroptional | text | Provide a HEX color code (example: #FFD966) |
textColoroptional | text | Provide a HEX color code (example: #FFD966) |
boldoptional | boolean | Make text bold |
italicoptional | boolean | Make text Italic |
strikethroughoptional | boolean | Make text Strikethrough |
get_next_rows
Get next row(s). Get next group of rows from a specifiec workheet
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | The ID of the spreadsheet to use. |
sheetIdrequired | id (picked from your account) | The ID of the worksheet to use. |
startRowrequired | number | Which row to start from? |
headerRowrequired | number | Which row contains the headers? |
useHeaderNamesoptional | boolean | Map A/B/C… to the actual column headers (row specified above). |
memKeyrequired | text | The key used to store the current row number in memory |
groupSizerequired | number | The number of rows to get |
get-many-rows
Get All Rows. Get all the rows from a specific sheet.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | The ID of the spreadsheet to use. |
sheetIdrequired | id (picked from your account) | The ID of the worksheet to use. |
first_row_headersrequired | boolean | First Row Contains Headers ? |
google-sheets-insert-multiple-rows
Add Multiple Rows. Add multiple rows of data at once to a specific spreadsheet.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | The ID of the spreadsheet to use. |
sheetIdrequired | id (picked from your account) | The ID of the worksheet to use. |
input_typerequired | one of "csv" | "json" | "column_names" | Select the format of the input values to be added into the worksheet. |
valuesrequired | object (depends on other props) | The values to add. |
overwriteoptional | boolean | Enable this option to replace all existing data in the sheet with new data from your input. This will clear any extra rows beyond the updated range. |
check_for_duplicateoptional | boolean | Enable this option to check for duplicate values before inserting data into the sheet. Only unique rows will be added based on the selected column. |
check_for_duplicate_columnoptional | object (depends on other props) | The column to check for duplicate values. |
as_stringoptional | boolean | Inserted values that are dates and formulas will be entered as strings and have no effect |
headerRowrequired | number | Enter the row number where your column headers are located (usually row 1). |
rename-worksheet
Rename Worksheet. Rename specific worksheet.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | The ID of the spreadsheet to use. |
sheetIdrequired | id (picked from your account) | The ID of the worksheet to rename. |
newNamerequired | text | New Sheet Name |
update-multiple-rows
Update Multiple Rows. Updates multiple rows in a specific spreadsheet.
| Input | Type | Description |
|---|---|---|
includeTeamDrivesoptional | boolean | Turn this on to also see spreadsheets from Shared Drives. |
spreadsheetIdrequired | id (picked from your account) | The ID of the spreadsheet to use. |
sheetIdrequired | id (picked from your account) | The ID of the worksheet to use. |
valuesrequired | object (depends on other props) | The values to update. |
as_stringoptional | boolean | Inserted values that are dates and formulas will be entered as strings and have no effect |
headerRowrequired | number | Which row contains the headers? |
Details
- Id
google_sheets- Category
- Productivity
- Tags
- spreadsheet, data, google, sheets
- Package
@activepieces/piece-google-sheets@0.14.6- Runs
- Through the integration runner