Google Sheets Integration
Want your spreadsheets to work smarter? Connect Google Sheets to SmythOS and let your agents read, write, and automate data in real time.
List of Google Sheets Components
Quickly compare Sheets components by what they do, how to use them, and their key I/O. Click any component name to jump directly to its detailed guide. Here’s what's available:
Component | Action | What it Does | Inputs | Key Outputs | Use Case |
---|---|---|---|---|---|
Get Values | Read | Reads values from a defined range. | required spreadsheetId , range , sheet optional majorDimension | values , response | Fetch customer list or static data. |
Update Values | Write | Overwrites cells in a specific range. | required spreadsheetId , range , sheet , values optional majorDimension , valueInputOption , includeValuesInResponse | updatedRange , updatedCells | Mark order as shipped, change statuses. |
Append Values | Write | Adds a new row after the last one. | required spreadsheetId , range , sheet , values optional majorDimension , valueInputOption , insertDataOption | updates , response | Log a form submission or event. |
Batch Update Values | Write | Updates multiple ranges in one API call. | required spreadsheetId , data optional valueInputOption , includeValuesInResponse | responses , response | Bulk update rows with different columns. |
Create Spreadsheet | Setup | Creates a brand-new spreadsheet. | required title optional locale , timeZone | spreadsheetId , spreadsheetUrl | Start a fresh data store or export. |
Get Spreadsheet | Read | Returns spreadsheet metadata and tab list. | required spreadsheetId | sheets , spreadsheetUrl | Check tab names before writing. |
Add Sheet | Setup | Adds a new tab to an existing sheet. | required spreadsheetId , title | replies , spreadsheetId | Create a new month like “July 2025”. |
Auto Resize Columns | Format | Fits column widths to content. | required spreadsheetId , sheetId , startIndex , endIndex | response | Clean up layout after writing data. |
Auto Resize Rows | Format | Fits row heights to content. | required spreadsheetId , sheetId , startIndex , endIndex | response | Adjust layout for wrapped text. |
Format Header Row | Format | Applies bold, centered header formatting. | required spreadsheetId , sheetId optional startRowIndex , endRowIndex , horizontalAlignment , fontSize | replies , response | Style header row consistently. |
Prerequisites
Before you begin the integration, please ensure you have the following:
- An active SmythOS account. (If you're new to SmythOS, you can sign up here.)
- A Google Account that has access to the Google Sheets you plan to use.
- Permission to interact with your Google Sheets during the authentication process.
Getting Started With Google Sheets
The connection between SmythOS and your Google Sheets is typically a one-time setup per Google account.
Step 1: Go to Integrations
- In your SmythOS dashboard, locate and click on the Integrations section. This is your center for connecting SmythOS to external services.
- From the list of available integrations, drag and drop any of the components under Google Sheets.
Step 2: Sign in with Google
This grants SmythOS secure permission to access your Google Sheets. You have two straightforward ways to initiate this:
-
Option A: The Direct
Authenticate
Button You'll often see a clear, blueAuthenticate
button directly on a Google Sheets component when you first add it, or if it's not yet connected. This is usually the quickest method. -
Option B: Via Component Settings If the direct button isn't visible, or if you prefer, you can usually find an
Authenticate
button within the settings of any Google Sheets component. Look for a tab labeled: "OAuth"
Authentication Process (Common to both options):
- You'll be guided to a Google Sign-In page. Log in using the Google account that owns or has access to the spreadsheets you wish to use with SmythOS.
- Google will then display a consent screen. This screen details the permissions SmythOS is requesting (e.g., to view and manage your spreadsheets). Take a moment to review these, then click Allow to proceed. We only request permissions necessary for the integration's functionality.
- Once you've granted permission, you'll be returned to SmythOS. The Google Sheets integration or component should now indicate that it's authenticated and ready for use. Connection Confirmed!
Step 3: Test the Connection
Before building workflows, confirm your Google Sheets integration is working.
1. Prepare a Test Sheet
- Open Google Sheets
- Create a new sheet or use an existing one
- Add sample data:
- Copy the spreadsheet ID from the URL (between
/d/
and/edit
)
2. Add and Configure "Get Values"
In SmythOS, add a Get Values component and configure it with:
3. Run and Confirm
- Run the component
- Check the
values
output:
- Ensure there are no errors in
response
orheaders
Common Google Sheets Parameters
Many Google Sheets components share the same input and output fields. Below are the standard parameters so you don’t have to memorize them per-component.
Field | Type | Description |
---|---|---|
spreadsheetId | string | Unique Sheet ID (found in the URL between /d/ and /edit ). |
sheet | string | Tab name (e.g. Sheet1 ). Case‑sensitive. Defaults to first tab when omitted. |
sheetId | string / integer | Numeric ID for a sheet. First tab is typically 0 . Needed by formatting components. |
range | string | A1 notation (Sheet1!A1:C10 ) or sheet name (Sheet1 ). Determines target cells. |
majorDimension | string | (Optional) ROWS (default) or COLUMNS ; affects array orientation. |
valueInputOption | string | (Optional) USER_ENTERED (auto‑parse) or RAW (literal). |
startIndex | integer | (Optional) 0‑based start index when operating on sequences (rows/columns). |
endIndex | integer | (Optional) 0‑based end index (exclusive) for sequences. |
spreadsheetId
— copy the long ID string in your browser’s address bar.sheet
—Sheet1
,sheet1
, andSHEET1
are treated as different names.
Google Sheets I/O Explained
Switch between Inputs and Outputs below to see detailed explanations, examples, and troubleshooting notes.
spreadsheetId
Unique Google Sheet ID — it sits between /d/
and /edit
in the URL.
https://docs.google.com/spreadsheets/d/**SPREADSHEET_ID**/edit
Which Google Sheet Component Should I Use With My Agent?
If you need to… | Typical Range / Target | Use this Component | Why this one? |
---|---|---|---|
Read a static block of data | Sheet1!A1:D20 | Get Values | Fast, single-range read. |
Log events (append a row) | Logs (sheet name only) | Append Values | Automatically finds the next empty row. |
Update a single cell or small range | Sheet1!C3 | Update Values | Direct, atomic overwrite. |
Write multiple disparate ranges in one call | Two or more A1 notations | Batch Update Values | Minimises API round-trips. |
Create a brand-new spreadsheet | — | Create Spreadsheet | Returns a fresh spreadsheetId for downstream steps. |
Add a new monthly tab | — | Add Sheet | Inserts a sheet titled for example “June 2025”. |
Auto-fit column widths | Column indices | Auto Resize Columns | Adjusts width based on cell content. |
Style the header row | Row index 0 | Format Header Row | Bold, centre, and optionally recolour headers. |
Component Details
This section provides detailed information for each Google Sheets component.
Get Values
Retrieves data from a defined range. Ideal for reading lists, logs, or configuration tables so your agent can act on live spreadsheet data.
Inputs
Field | Required | Notes |
---|---|---|
spreadsheetId | required | Sheet ID from URL (/d/{id}/edit ). |
range | required | A1 notation (e.g. Sheet1!A1:C10 ) or named range. |
sheet | required | Tab name; defaults to Sheet1 . |
majorDimension | optional | ROWS (default) or COLUMNS . |
Outputs
Field | Description |
---|---|
values | 2‑D array of returned data. |
response | Raw API payload (for debugging). |
headers | HTTP headers (rate-limit info, etc). |
{
"component": "sheets.getValues",
"spreadsheetId": "1AbcXYZexampleId",
"range": "SupportTickets!A2:E",
"sheet": "SupportTickets",
"majorDimension": "ROWS"
}
Update Values
Overwrites existing data in a specified range. Use this to modify individual cells or update entire rows/columns with new values reflecting the latest status or calculations.
Inputs
Field | Required | Notes |
---|---|---|
spreadsheetId | required | Sheet ID from URL. |
range | required | A1 notation for cells to update (e.g., Sheet1!B2 ). |
sheet | required | Tab name where update occurs. |
values | required | 2D array of data to write. E.g., [["Shipped"]] or [["Row1Col1", "Row1Col2"]] . |
majorDimension | optional | Layout of values: ROWS (default) or COLUMNS . |
valueInputOption | optional | How Google parses input: USER_ENTERED (default) or RAW . |
includeValuesInResponse | optional | true (default) or false ; include updated values in output. |
Outputs
Field | Description |
---|---|
spreadsheetId | ID of the updated sheet. |
updatedRange | A1 notation of the range that was updated. |
updatedRows | Count of rows affected. |
updatedColumns | Count of columns affected. |
updatedCells | Total cells modified. |
response | Raw API payload. |
headers | HTTP headers. |
{
"component": "sheets.updateValues",
"spreadsheetId": "yourSpreadsheetId",
"range": "Orders!C2",
"sheet": "Orders",
"values": [["Shipped"]],
"valueInputOption": "USER_ENTERED"
}
Append Values — Add Rows to Sheet
Adds new data as additional rows to an existing sheet. It automatically finds the last filled row in the specified range (or entire sheet) and inserts content after it.
Inputs
Field | Required | Notes |
---|---|---|
spreadsheetId | required | Sheet ID from URL. |
range | required | Sheet name (e.g., Sheet1 ) or A1 range (e.g., Sheet1!A:C ) to append to. |
sheet | required | Tab name to append to. |
values | required | 2D array of new row data. E.g., [["New Feedback", "Positive"]] . |
majorDimension | optional | Layout of values: ROWS (default) or COLUMNS . |
valueInputOption | optional | How Google parses input: USER_ENTERED (default) or RAW . |
insertDataOption | optional | INSERT_ROWS (default) or OVERWRITE . |
Outputs
Field | Description |
---|---|
spreadsheetId | ID of the modified sheet. |
updates | Object with details: updatedRange , updatedRows , updatedColumns , updatedCells . |
response | Raw API payload. |
headers | HTTP headers. |
{
"component": "sheets.appendValues",
"spreadsheetId": "yourSpreadsheetId",
"range": "FeedbackLog!A:B",
"sheet": "FeedbackLog",
"values": [["Great service!", "5 Stars"]],
"insertDataOption": "INSERT_ROWS"
}
Batch Update Values
Performs multiple updates across different ranges within a single sheet in one API call. Ideal for efficiency when several areas need modification.Inputs
Field | Required | Notes |
---|---|---|
spreadsheetId | required | Sheet ID from URL. |
valueInputOption | optional | Default input parsing for all blocks: USER_ENTERED (default) or RAW . Can be overridden per block. |
includeValuesInResponse | optional | true (default) or false ; return written values in output. |
data | required | Array of update blocks. Each block needs range (string) and values (2D array). Optional: majorDimension . |
Outputs
Field | Description |
---|---|
spreadsheetId | ID of the target sheet. |
totalUpdatedRows | Sum of rows updated across all batches. |
totalUpdatedColumns | Sum of columns updated. |
totalUpdatedCells | Sum of cells updated. |
responses | Array of results, one for each update block in data . |
response | Raw API payload for the entire batch operation. |
headers | HTTP headers. |
{
"component": "sheets.batchUpdateValues",
"spreadsheetId": "yourSpreadsheetId",
"data": [
{
"range": "Sheet1!C5",
"values": [["Complete"]]
},
{
"range": "Sheet1!D5",
"values": [["2024-01-15"]]
},
{
"range": "NotesSheet!A20",
"values": [["Project XYZ finalized."]]
}
]
}
Create Spreadsheet
Instructs your agent to generate a brand new Google Sheet document.
Inputs
Field | Required | Notes |
---|---|---|
title | required | The title for the new spreadsheet document. |
sheetName | optional | Name for the first sheet (tab) in the new document. Defaults to Sheet1 . |
Outputs
Field | Description |
---|---|
spreadsheetId | Crucial: The ID of the newly created spreadsheet. |
properties | Object with details: title , locale , timeZone . |
sheets | Array of sheet objects (initially one). |
spreadsheetUrl | Direct link to the new Google Sheet. |
response | Raw API payload. |
headers | HTTP headers. |
{
"component": "sheets.createSpreadsheet",
"title": "Monthly Performance - July 2024",
"sheetName": "Daily Metrics"
}
Get Spreadsheet
Retrieves structural information and metadata about an existing Google Sheet, such as its properties, all its sheets (tabs), and named ranges.
Inputs
Field | Required | Notes |
---|---|---|
spreadsheetId | required | Sheet ID from URL to inspect. |
Outputs
Field | Description |
---|---|
spreadsheetId | ID of the queried sheet. |
properties | Object with general details: title , locale , timeZone , autoRecalc . |
sheets | Array of all sheet (tab) objects in the document, each with sheetId , title , index , sheetType , gridProperties . |
namedRanges | Array of all named ranges, each with name , range , namedRangeId . |
spreadsheetUrl | Direct link to the Google Sheet. |
response | Raw API payload. |
headers | HTTP headers. |
{
"component": "sheets.getSpreadsheet",
"spreadsheetId": "yourExistingSpreadsheetId"
}
Add Sheet
Inserts a new sheet (tab) into an existing Google Spreadsheet document.
Inputs
Field | Required | Notes |
---|---|---|
spreadsheetId | required | ID of the spreadsheet to add the new tab to. |
title | required | Name for the new sheet/tab. Must be unique within the spreadsheet. |
Outputs
Field | Description |
---|---|
replies | Array containing an addSheet object with the new tab's properties (like sheetId , title , index ). |
spreadsheetId | ID of the modified spreadsheet. |
response | Raw API payload. |
headers | HTTP headers. |
{
"component": "sheets.addSheet",
"spreadsheetId": "yourMasterSpreadsheetId",
"title": "July 2024 Sales"
}
Auto Resize Column(s)
Automatically resizes one or more columns in a specified sheet to match the width of their contents, improving readability.
Inputs
Field | Required | Notes |
---|---|---|
spreadsheetId | required | Sheet ID from URL. |
sheetId | required | Numerical ID of the sheet (tab) containing columns to resize. Often 0 for the first sheet. |
startIndex | required | 0-based starting column index to resize (e.g., 0 for column A). |
endIndex | required | 0-based ending column index (exclusive). To resize column A only, startIndex=0 , endIndex=1 . |
Outputs
Field | Description |
---|---|
spreadsheetId | ID of the updated spreadsheet. |
response | Raw API payload. |
headers | HTTP headers. |
{
"component": "sheets.autoResizeColumns",
"spreadsheetId": "yourSpreadsheetId",
"sheetId": 0,
"startIndex": 0,
"endIndex": 3
}
Auto Resize Row(s)
Automatically adjusts the height of one or more rows in a specified sheet to fit their content. Ideal for multi-line text entries.
Inputs
Field | Required | Notes |
---|---|---|
spreadsheetId | required | Sheet ID from URL. |
sheetId | required | Numerical ID of the sheet (tab) containing rows to resize. |
startIndex | required | 0-based starting row index to resize (e.g., 0 for row 1). |
endIndex | required | 0-based ending row index (exclusive). To resize row 1 only, startIndex=0 , endIndex=1 . |
Outputs
Field | Description |
---|---|
spreadsheetId | ID of the modified sheet. |
response | Raw API payload. |
headers | HTTP headers. |
{
"component": "sheets.autoResizeRows",
"spreadsheetId": "yourSpreadsheetId",
"sheetId": 0,
"startIndex": 4,
"endIndex": 10
}
Format Header Row
Applies consistent styling (e.g., bold text, center alignment, background color) to a specified header row, making tables easier to read.
Inputs
Field | Required | Notes |
---|---|---|
spreadsheetId | required | Sheet ID from URL. |
sheetId | required | Numerical ID of the sheet (tab). Default is usually 0 . |
startRowIndex | optional | 0-based row index to start formatting. Default: 0 (first row). |
endRowIndex | optional | 0-based row index to end formatting (exclusive). Default: 1 (formats only startRowIndex ). |
horizontalAlignment | optional | Text alignment: CENTER (default), LEFT , RIGHT . |
fontSize | optional | Font size for header text. Default: 12 . |
bold | optional | Make text bold: true (default) or false . |
backgroundColor | optional | Object defining RGB color. E.g., "red": 0.8, "green": 0.8, "blue": 0.8. |
Outputs
Field | Description |
---|---|
spreadsheetId | ID of the updated spreadsheet. |
replies | Array of responses for formatting requests. |
response | Raw API payload. |
headers | HTTP headers. |
{
"component": "sheets.formatHeaderRow",
"spreadsheetId": "yourSpreadsheetId",
"sheetId": 0,
"startRowIndex": 0,
"endRowIndex": 1,
"horizontalAlignment": "CENTER",
"bold": true,
"backgroundColor": { "red": 0.9, "green": 0.9, "blue": 0.9 }
}
Best Practices & Advanced Tips
To make the most of your Google Sheets integration, consider these tips:
- Use "Batch Update Values" for Efficiency: When you need to make multiple changes to a sheet (e.g., updating several cells, writing multiple rows), the "Batch Update Values" component is significantly more efficient than making individual "Update Values" calls. This reduces the number of API requests and can help avoid rate limits.
- Manage IDs Dynamically: Instead of hardcoding
spreadsheetId
orsheetId
, use outputs from previous steps (like "Create Spreadsheet" or "Get Spreadsheet") or SmythOS variables to manage these IDs dynamically. This makes your agents more robust and adaptable. - Error Handling:
- Always check the outputs of components for success or failure indicators.
- Use the
response
object from components to get detailed error messages from the Google Sheets API, which can be invaluable for debugging. - Implement conditional logic in your agent to handle potential errors gracefully (e.g., retry an operation, send a notification, or take an alternative path).
- Data Validation: Before writing data to Google Sheets, especially if it comes from external sources or user input, validate it within your SmythOS agent to ensure it's in the correct format and type. This prevents errors and maintains data integrity in your spreadsheets.
- Understand Quotas and Limits: Be aware of Google Sheets API usage quotas (e.g., requests per minute, requests per day). Design your agents to stay within these limits. For very frequent operations, consider strategies like queuing requests or summarizing data before writing. Refer to Google's official documentation for the most current quota information.
- Secure Your Sheets:
- Grant the Google Account connected to SmythOS only the necessary permissions (e.g., if an agent only needs to read data, ensure the account doesn't have unnecessary write access to sensitive sheets).
- Regularly review who has access to your integrated spreadsheets.
- Clear Naming Conventions: Use clear and consistent names for your spreadsheets, sheets (tabs), and named ranges. This makes it easier to configure components and maintain your agents.
- Optimize
range
Specificity:- For "Append Values," if you want to append to the very end of all data in a sheet, providing just the sheet name (e.g.,
Sheet1
) in therange
input is often best. - For "Get Values" or "Update Values," be as specific as possible with your
range
to avoid processing unnecessary data.
- For "Append Values," if you want to append to the very end of all data in a sheet, providing just the sheet name (e.g.,
- Test Thoroughly: Before deploying agents that interact with critical spreadsheets, test them thoroughly in a development or staging environment with sample data.
Troubleshooting Common Issues
Encountering an issue with your Google Sheets integration? Here are solutions to some common problems:
-
Error:
Requested entity was not found
(or a404
error)- Possible Cause(s): Could be an incorrect
spreadsheetId
, a mistypedsheet
name (remember, tab names are case-sensitive!), or an invalidrange
. - Solution(s): Carefully double-check the
spreadsheetId
from your Google Sheet's URL. Ensure thesheet
name is an exact match, character for character. Verify that yourrange
(e.g.,Sheet1!A1:C5
) is valid for that specific sheet.
- Possible Cause(s): Could be an incorrect
-
Error:
PERMISSION_DENIED
(or a403
error)- Possible Cause(s): Either SmythOS lacks the necessary permissions for your Google Account, or the specific Google Sheet has restrictive sharing settings.
- Solution(s):
- Try re-authenticating: Go to SmythOS Integrations, find Google Sheets, deauthenticate, and then authenticate again. Make sure you grant all requested permissions during the Google consent process.
- Check the Google Sheet's "Share" settings. The Google account you've connected to SmythOS must have "Editor" access for writing/updating or at least "Viewer" access for read-only operations like "Get Values."
-
Data Not Updating Correctly or Appearing in the Wrong Cells
- Possible Cause(s): Often an incorrect
range
specification in components like "Update Values," or a mismatch between yourmajorDimension
setting and the structure of yourvalues
array. - Solution(s): Meticulously review your
range
input. For "Update Values" and "Append Values," ensure yourvalues
data structure aligns perfectly with the columns in yourrange
and yourmajorDimension
setting.
- Possible Cause(s): Often an incorrect
-
Exceeding API Rate Limits or Other Google Quotas
- Possible Cause(s): Google Sheets, like many services, imposes limits on API call frequency, the number of characters in a cell, and overall spreadsheet size.
- Solution(s): For large data operations, consider processing your data in smaller batches. If you're making very frequent updates, the "Batch Update Values" component is your best friend where possible. You might also introduce slight, strategic delays in your agent's workflow. For the most current details, Google's official API documentation is the place to look.
What's Next?
Congratulations! You've successfully set up the SmythOS Google Sheets integration and explored its powerful components. You're now equipped to build agents that can intelligently interact with your spreadsheet data in all sorts of creative ways.
Consider these next steps on your journey:
- Build an Agent That...
- Reads a to-do list from a Google Sheet each morning and sends you a personalized summary via email or Slack (by combining this with other SmythOS integrations!).
- Collects entries from a web form, processes the data, and then neatly logs each submission into a new row in a Google Sheet.
- Monitors a specific range in a Google Sheet for new entries and automatically triggers a downstream workflow when new data appears.
- Combine the power of Google Sheets with other SmythOS integrations to create sophisticated, multi-step automations. Consider exploring our Google Gmail Integration or our database connector tools.