ByteChef LogoByteChef

Google Sheets

Google Sheets is a cloud-based spreadsheet software that allows users to create, edit, and collaborate on spreadsheets in real-time.

Categories: Productivity and Collaboration

Type: googleSheets/v1


Connections

Version: 1

OAuth2 Authorization Code

Properties

NameLabelTypeDescriptionRequired
clientIdClient IdSTRINGtrue
clientSecretClient SecretSTRINGtrue

Connection Setup

Create OAuth 2.0 Application

Creation of OAuth 2.0 application is documented here.

Enable Google Sheets API

  1. In the Google Cloud Console, select your project.
  2. Go to the APIs & Services.
  3. Click on ENABLE APIS AND SERVICES.
  4. Search for "google sheets api" in the search bar.
  5. Click on Google Sheets API.
  6. Click Enable.

Enable Google Drive API

  1. In the Google Cloud Console, select your project.
  2. Go to the APIs & Services.
  3. Click on ENABLE APIS AND SERVICES.
  4. Search for "google drive api" in the search bar.
  5. Click on Google Drive API.
  6. Click Enable.

Actions

Clear Sheet

Name: clearSheet

Clear a sheet of all values while preserving formats.

Properties

NameLabelTypeDescriptionRequired
spreadsheetIdSpreadsheet IDSTRINGThe ID of the spreadsheet to apply the updates to.true
sheetIdSheet IDINTEGER
Depends On spreadsheetId
The ID of the sheet.true
isTheFirstRowHeaderIs the First Row Headers?BOOLEAN
Options true, false
If the first row is header.true

Example JSON Structure

{
  "label" : "Clear Sheet",
  "name" : "clearSheet",
  "parameters" : {
    "spreadsheetId" : "",
    "sheetId" : 1,
    "isTheFirstRowHeader" : false
  },
  "type" : "googleSheets/v1/clearSheet"
}

Output

This action does not produce any output.

Find Spreadsheet ID

To find the Spreadsheet ID, click here

Find Sheet ID

To find the Sheet ID, click here

Create Column

Name: createColumn

Append a new column to the end of the sheet.

Properties

NameLabelTypeDescriptionRequired
spreadsheetIdSpreadsheet IDSTRINGThe ID of the spreadsheet to apply the updates to.true
sheetNameSheet NameSTRING
Depends On spreadsheetId
The name of the sheet.true
columnNameColumn NameSTRINGName of the new column.true

Example JSON Structure

{
  "label" : "Create Column",
  "name" : "createColumn",
  "parameters" : {
    "spreadsheetId" : "",
    "sheetName" : "",
    "columnName" : ""
  },
  "type" : "googleSheets/v1/createColumn"
}

Output

Type: OBJECT

Properties

NameTypeDescription
spreadsheetIdSTRINGID of the spreadsheet.
sheetNameSTRINGName of the sheet.
headersARRAY
Items [STRING]
List of headers on the sheet.

Output Example

{
  "spreadsheetId" : "",
  "sheetName" : "",
  "headers" : [ "" ]
}

Find Spreadsheet ID

To find the Spreadsheet ID, click here

Find Sheet Name

To find the Sheet Name, click here

Create Sheet

Name: createSheet

Create a blank sheet with title. Optionally, provide headers.

Properties

NameLabelTypeDescriptionRequired
spreadsheetIdSpreadsheet IDSTRINGThe ID of the spreadsheet to apply the updates to.true
sheetNameSheet NameSTRINGThe name of the new sheet.true
headersHeadersARRAY
Items [STRING]
The headers of the new sheet.false

Example JSON Structure

{
  "label" : "Create Sheet",
  "name" : "createSheet",
  "parameters" : {
    "spreadsheetId" : "",
    "sheetName" : "",
    "headers" : [ "" ]
  },
  "type" : "googleSheets/v1/createSheet"
}

Output

Type: OBJECT

Properties

NameTypeDescription
spreadsheetIdSTRINGID of the spreadsheet.
sheetNameSTRINGName of the sheet.
headersARRAY
Items [STRING]
List of headers on the sheet.

Output Example

{
  "spreadsheetId" : "",
  "sheetName" : "",
  "headers" : [ "" ]
}

Find Spreadsheet ID

To find the Spreadsheet ID, click here

Create Spreadsheet

Name: createSpreadsheet

Create a new spreadsheet in a specified folder.

Properties

NameLabelTypeDescriptionRequired
titleTitleSTRINGTitle of the new spreadsheet to be created.true
folderIdFolder IDSTRINGID of the folder where the new spreadsheet will be stored. If no folder is selected, the folder will be created in the root folder.false

Example JSON Structure

{
  "label" : "Create Spreadsheet",
  "name" : "createSpreadsheet",
  "parameters" : {
    "title" : "",
    "folderId" : ""
  },
  "type" : "googleSheets/v1/createSpreadsheet"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

Find Folder ID

To find the Folder ID, click here

Delete Column

Name: deleteColumn

Deletes column on an existing sheet. Remaining columns will be shifted to the left.

Properties

NameLabelTypeDescriptionRequired
spreadsheetIdSpreadsheet IDSTRINGThe ID of the spreadsheet to apply the updates to.true
sheetIdSheet IDINTEGER
Depends On spreadsheetId
The ID of the sheet.true
labelColumn LabelSTRINGThe label of the column to be deleted.true

Example JSON Structure

{
  "label" : "Delete Column",
  "name" : "deleteColumn",
  "parameters" : {
    "spreadsheetId" : "",
    "sheetId" : 1,
    "label" : ""
  },
  "type" : "googleSheets/v1/deleteColumn"
}

Output

This action does not produce any output.

Find Spreadsheet ID

To find the Spreadsheet ID, click here

Find Sheet ID

To find the Sheet ID, click here

Delete Row

Name: deleteRow

Deletes row on an existing sheet. Remaining rows will be shifted up.

Properties

NameLabelTypeDescriptionRequired
spreadsheetIdSpreadsheet IDSTRINGThe ID of the spreadsheet to apply the updates to.true
sheetIdSheet IDINTEGER
Depends On spreadsheetId
The ID of the sheet.true
rowNumberRow NumberINTEGERThe row number to delete.true

Example JSON Structure

{
  "label" : "Delete Row",
  "name" : "deleteRow",
  "parameters" : {
    "spreadsheetId" : "",
    "sheetId" : 1,
    "rowNumber" : 1
  },
  "type" : "googleSheets/v1/deleteRow"
}

Output

This action does not produce any output.

Find Spreadsheet ID

To find the Spreadsheet ID, click here

Find Sheet ID

To find the Sheet ID, click here

Delete Sheet

Name: deleteSheet

Delete a specified sheet from a spreadsheet.

Properties

NameLabelTypeDescriptionRequired
spreadsheetIdSpreadsheet IDSTRINGThe ID of the spreadsheet to apply the updates to.true
sheetIdSheet IDINTEGER
Depends On spreadsheetId
The ID of the sheet.true

Example JSON Structure

{
  "label" : "Delete Sheet",
  "name" : "deleteSheet",
  "parameters" : {
    "spreadsheetId" : "",
    "sheetId" : 1
  },
  "type" : "googleSheets/v1/deleteSheet"
}

Output

This action does not produce any output.

Find Spreadsheet ID

To find the Spreadsheet ID, click here

Find Sheet ID

To find the Sheet ID, click here

Find Row by Number

Name: findRowByNum

Get a row in a Google Sheet by row number.

Properties

NameLabelTypeDescriptionRequired
spreadsheetIdSpreadsheet IDSTRINGThe ID of the spreadsheet to apply the updates to.true
sheetNameSheet NameSTRING
Depends On spreadsheetId
The name of the sheet.true
isTheFirstRowHeaderIs the First Row Headers?BOOLEAN
Options true, false
If the first row is header.true
rowNumberRow NumberINTEGERThe row number to get from the sheet.true

Example JSON Structure

{
  "label" : "Find Row by Number",
  "name" : "findRowByNum",
  "parameters" : {
    "spreadsheetId" : "",
    "sheetName" : "",
    "isTheFirstRowHeader" : false,
    "rowNumber" : 1
  },
  "type" : "googleSheets/v1/findRowByNum"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

Get Rows

Name: getRows

Get all rows from a Google Sheet.

Properties

NameLabelTypeDescriptionRequired
spreadsheetIdSpreadsheet IDSTRINGThe ID of the spreadsheet to apply the updates to.true
sheetNameSheet NameSTRING
Depends On spreadsheetId
The name of the sheet.true
isTheFirstRowHeaderIs the First Row Headers?BOOLEAN
Options true, false
If the first row is header.true

Example JSON Structure

{
  "label" : "Get Rows",
  "name" : "getRows",
  "parameters" : {
    "spreadsheetId" : "",
    "sheetName" : "",
    "isTheFirstRowHeader" : false
  },
  "type" : "googleSheets/v1/getRows"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

Find Spreadsheet ID

To find the Spreadsheet ID, click here

Find Sheet Name

To find the Sheet Name, click here

Insert Multiple Rows

Name: insertMultipleRows

Append rows to the end of the spreadsheet.

Properties

NameLabelTypeDescriptionRequired
spreadsheetIdSpreadsheet IDSTRINGThe ID of the spreadsheet to apply the updates to.true
sheetNameSheet NameSTRING
Depends On spreadsheetId
The name of the sheet.true
valueInputOptionValue Input OptionSTRING
Options RAW, USER_ENTERED
How the input data should be interpreted.true
isTheFirstRowHeaderIs the First Row Headers?BOOLEAN
Options true, false
If the first row is header.true
rowsDYNAMIC_PROPERTIES
Depends On spreadsheetId, sheetName, isTheFirstRowHeader
true

Example JSON Structure

{
  "label" : "Insert Multiple Rows",
  "name" : "insertMultipleRows",
  "parameters" : {
    "spreadsheetId" : "",
    "sheetName" : "",
    "valueInputOption" : "",
    "isTheFirstRowHeader" : false,
    "rows" : { }
  },
  "type" : "googleSheets/v1/insertMultipleRows"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

Find Spreadsheet ID

To find the Spreadsheet ID, click here

Find Sheet Name

To find the Sheet Name, click here

Insert Row

Name: insertRow

Append a row of values to an existing sheet.

Properties

NameLabelTypeDescriptionRequired
spreadsheetIdSpreadsheet IDSTRINGThe ID of the spreadsheet to apply the updates to.true
sheetNameSheet NameSTRING
Depends On spreadsheetId
The name of the sheet.true
valueInputOptionValue Input OptionSTRING
Options RAW, USER_ENTERED
How the input data should be interpreted.true
isTheFirstRowHeaderIs the First Row Headers?BOOLEAN
Options true, false
If the first row is header.true
rowDYNAMIC_PROPERTIES
Depends On spreadsheetId, sheetName, isTheFirstRowHeader
true

Example JSON Structure

{
  "label" : "Insert Row",
  "name" : "insertRow",
  "parameters" : {
    "spreadsheetId" : "",
    "sheetName" : "",
    "valueInputOption" : "",
    "isTheFirstRowHeader" : false,
    "row" : { }
  },
  "type" : "googleSheets/v1/insertRow"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

Find Spreadsheet ID

To find the Spreadsheet ID, click here

Find Sheet Name

To find the Sheet Name, click here

List Sheets

Name: listSheets

Get all sheets from the spreadsheet.

Properties

NameLabelTypeDescriptionRequired
spreadsheetIdSpreadsheet IDSTRINGThe ID of the spreadsheet to apply the updates to.true

Example JSON Structure

{
  "label" : "List Sheets",
  "name" : "listSheets",
  "parameters" : {
    "spreadsheetId" : ""
  },
  "type" : "googleSheets/v1/listSheets"
}

Output

Type: ARRAY

Items Type: OBJECT

Properties

NameTypeDescription
spreadsheetIdSTRINGID of the spreadsheet.
sheetNameSTRINGName of the sheet.
headersARRAY
Items [STRING]
List of headers on the sheet.

Output Example

[ {
  "spreadsheetId" : "",
  "sheetName" : "",
  "headers" : [ "" ]
} ]

Find Spreadsheet ID

To find the Spreadsheet ID, click here

Update Row

Name: updateRow

Overwrite values in an existing row.

Properties

NameLabelTypeDescriptionRequired
spreadsheetIdSpreadsheet IDSTRINGThe ID of the spreadsheet to apply the updates to.true
sheetNameSheet NameSTRING
Depends On spreadsheetId
The name of the sheet.true
rowNumberRow NumberINTEGERThe row number to update.true
isTheFirstRowHeaderIs the First Row Headers?BOOLEAN
Options true, false
If the first row is header.true
updateWholeRowUpdate Whole RowBOOLEAN
Options true, false
Whether to update the whole row or just specific columns.true
rowDYNAMIC_PROPERTIES
Depends On spreadsheetId, sheetName, isTheFirstRowHeader, updateWholeRow
true

Example JSON Structure

{
  "label" : "Update Row",
  "name" : "updateRow",
  "parameters" : {
    "spreadsheetId" : "",
    "sheetName" : "",
    "rowNumber" : 1,
    "isTheFirstRowHeader" : false,
    "updateWholeRow" : false,
    "row" : { }
  },
  "type" : "googleSheets/v1/updateRow"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

Find Spreadsheet ID

To find the Spreadsheet ID, click here

Find Sheet Name

To find the Sheet Name, click here

Triggers

New Row

Name: newRow

Triggers when a new row is added.

Type: DYNAMIC_WEBHOOK

Properties

NameLabelTypeDescriptionRequired
spreadsheetIdSpreadsheetSTRINGThe spreadsheet to apply the updates to.true
isTheFirstRowHeaderIs the First Row Headers?BOOLEAN
Options true, false
If the first row is header.true
sheetNameSheetSTRING
Depends On spreadsheetId
The name of the sheettrue

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

JSON Example

{
  "label" : "New Row",
  "name" : "newRow",
  "parameters" : {
    "spreadsheetId" : "",
    "isTheFirstRowHeader" : false,
    "sheetName" : ""
  },
  "type" : "googleSheets/v1/newRow"
}

Find Spreadsheet ID

To find the Spreadsheet ID, click here

Find Sheet Name

To find the Sheet Name, click here

What to do if your action is not listed here?

If this component doesn't have the action you need, you can use Custom Action to create your own. Custom Actions empower you to define HTTP requests tailored to your specific requirements, allowing for greater flexibility in integrating with external services or APIs.

To create a Custom Action, simply specify the desired HTTP method, path, and any necessary parameters. This way, you can extend the functionality of your component beyond the predefined actions, ensuring that you can meet all your integration needs effectively.


Additional Instructions

How to find Spreadsheet ID

You can find your Spreadsheet ID in the URL of your Google Sheets document. For example, in the URL https://docs.google.com/spreadsheets/d/1fEIYXSdLufVgmOO2532dxaelu1J1bXXMNFFAS2DHFZuw/edit?gid=1579592398#gid=1579592398, the Spreadsheet ID is 1fEIYXSdLufVgmOO2532dxaelu1J1bXXMNFFAS2DHFZuw.

How to find Sheet ID

You can find your Sheet ID in the URL of your Google Sheets document. For example, in the URL https://docs.google.com/spreadsheets/d/1fEIYXSdLufVgmOO2532dxaelu1J1bXXMNFFAS2DHFZuw/edit?gid=1579592398#gid=1579592398, the Sheet ID is 1579592398.

How to find Sheet Name

You can find your Sheet name by looking at the Bottoms Tabs:

  1. Open your Google Sheets document.
  2. At the bottom left, you’ll see tabs like: (the tabs at the bottom of the screen that show the names of your sheets).
  3. The text on each tab is the sheet name.
  4. The highlighted tab is the currently active sheet.

How to find Folder ID

You can find your Folder ID in the URL of your Google Drive folder. For example, in the URL https://drive.google.com/drive/folders/1fEIYXSdLufVgmOO2532dxaelu1J1bXXMNFFAS2DHFZuw, the Folder ID is 1fEIYXSdLufVgmOO2532dxaelu1J1bXXMNFFAS2DHFZuw.

Troubleshooting

Access Blocked: Verification Process Not Completed

Documentation for how to add a test user can be found here

How is this guide?

Last updated on

On this page

Connections
OAuth2 Authorization Code
Properties
Connection Setup
Create OAuth 2.0 Application
Enable Google Sheets API
Enable Google Drive API
Actions
Clear Sheet
Properties
Example JSON Structure
Output
Find Spreadsheet ID
Find Sheet ID
Create Column
Properties
Example JSON Structure
Output
Properties
Output Example
Find Spreadsheet ID
Find Sheet Name
Create Sheet
Properties
Example JSON Structure
Output
Properties
Output Example
Find Spreadsheet ID
Create Spreadsheet
Properties
Example JSON Structure
Output
Find Folder ID
Delete Column
Properties
Example JSON Structure
Output
Find Spreadsheet ID
Find Sheet ID
Delete Row
Properties
Example JSON Structure
Output
Find Spreadsheet ID
Find Sheet ID
Delete Sheet
Properties
Example JSON Structure
Output
Find Spreadsheet ID
Find Sheet ID
Find Row by Number
Properties
Example JSON Structure
Output
Get Rows
Properties
Example JSON Structure
Output
Find Spreadsheet ID
Find Sheet Name
Insert Multiple Rows
Properties
Example JSON Structure
Output
Find Spreadsheet ID
Find Sheet Name
Insert Row
Properties
Example JSON Structure
Output
Find Spreadsheet ID
Find Sheet Name
List Sheets
Properties
Example JSON Structure
Output
Properties
Output Example
Find Spreadsheet ID
Update Row
Properties
Example JSON Structure
Output
Find Spreadsheet ID
Find Sheet Name
Triggers
New Row
Properties
Output
JSON Example
Find Spreadsheet ID
Find Sheet Name
What to do if your action is not listed here?
Additional Instructions
How to find Spreadsheet ID
How to find Sheet ID
How to find Sheet Name
How to find Folder ID
Troubleshooting
Access Blocked: Verification Process Not Completed