Integrations / Google Sheets
Google Sheets
Read and write spreadsheet data in Google Sheets.
5 actions
OAuth 2
2 read3 write
Calls sheets.googleapis.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "googlesheets" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
| Scope | Why it is requested |
|---|---|
https://www.googleapis.com/auth/userinfo.email | See which Google account you connected |
https://www.googleapis.com/auth/spreadsheets | See, edit, create and delete your Google Sheets spreadsheets |
Actions
Append rowswritegooglesheets.append_rowsAdd rows after the last row of data in a sheet.
Needs scope: https://www.googleapis.com/auth/spreadsheets
| Input | Type | Description | |
|---|---|---|---|
spreadsheet_id | string | Required | The long ID in the spreadsheet address |
range | string | Required | A1 notation, for example Sheet1!A1:D20 |
values | array of array | Required | Rows to add, each a list of cell values |
await setu.execute({
userId: "user_1",
action: "googlesheets.append_rows",
input: {
"spreadsheet_id": "<spreadsheet_id>",
"range": "<range>",
"values": []
},
});Create spreadsheetwritegooglesheets.create_spreadsheetCreate a new, empty spreadsheet.
Needs scope: https://www.googleapis.com/auth/spreadsheets
| Input | Type | Description | |
|---|---|---|---|
title | string | Required | Spreadsheet title |
await setu.execute({
userId: "user_1",
action: "googlesheets.create_spreadsheet",
input: {
"title": "<title>"
},
});Get spreadsheetreadgooglesheets.get_spreadsheetGet a spreadsheet's title and the names of its sheets.
Needs scope: https://www.googleapis.com/auth/spreadsheets
| Input | Type | Description | |
|---|---|---|---|
spreadsheet_id | string | Required | The long ID in the spreadsheet address |
await setu.execute({
userId: "user_1",
action: "googlesheets.get_spreadsheet",
input: {
"spreadsheet_id": "<spreadsheet_id>"
},
});Read rangereadgooglesheets.read_rangeRead cell values from a range such as Sheet1!A1:D20.
Needs scope: https://www.googleapis.com/auth/spreadsheets
| Input | Type | Description | |
|---|---|---|---|
spreadsheet_id | string | Required | The long ID in the spreadsheet address |
range | string | Required | A1 notation, for example Sheet1!A1:D20 |
await setu.execute({
userId: "user_1",
action: "googlesheets.read_range",
input: {
"spreadsheet_id": "<spreadsheet_id>",
"range": "<range>"
},
});Update rangewritegooglesheets.update_rangeOverwrite the cells in a range with new values.
Needs scope: https://www.googleapis.com/auth/spreadsheets
| Input | Type | Description | |
|---|---|---|---|
spreadsheet_id | string | Required | The long ID in the spreadsheet address |
range | string | Required | A1 notation, for example Sheet1!A1:D20 |
values | array of array | Required | Rows of cell values |
await setu.execute({
userId: "user_1",
action: "googlesheets.update_range",
input: {
"spreadsheet_id": "<spreadsheet_id>",
"range": "<range>",
"values": []
},
});