1. Overview
Google Sheets is a cloud-based spreadsheet application that allows users to create, edit, and share spreadsheets online. It offers real-time collaboration capabilities and seamless integration with other Google Workspace applications.
Through GoInsight's Google Sheets node, you can seamlessly integrate spreadsheet operations into your automation workflows. You can achieve comprehensive lifecycle management of spreadsheets, sheets, and cell data, including:
- Creating and deleting entire spreadsheet files and individual sheets.
- Reading, appending, updating, and clearing data within sheets.
- Deleting specific rows or columns from your spreadsheets.
- Managing sheet structure by creating new sheets or removing existing ones.
2. Prerequisites
Before using this node, you need to have a valid Google account with access to Google Sheets. You may need administrator or specific permissions to create and manage API credentials for programmatic access to your Google Sheets data.
3. Credentials
For detailed guidance on how to obtain and configure credentials, please refer to our official documentation: Credentials Configuration Guide.
4. Supported Operations
Summary
This node primarily operates on the following core resources within Google Sheets: Spreadsheet, Sheet, Row/Column, and Cell.
| Resource | Operation | Description |
|---|---|---|
| Spreadsheet | Create Spreadsheets | Creates a new Google Spreadsheet with the given title and optional sheet data. |
| Spreadsheet | Delete Spreadsheet | Permanently deletes the specified Google Sheets spreadsheet. |
| Sheet | Create Sheet | Creates a new worksheet (sheet) within an existing Google Sheets document. |
| Sheet | Delete Sheet | Permanently deletes a sheet from a Google Sheets spreadsheet by name. |
| Sheet | Clear Sheet | Clears all data in the specified range of a Google Sheets spreadsheet. |
| Row/Column | Delete Rows or Columns | Permanently deletes rows or columns from the sheet. |
| Row/Column | Get Rows in Sheet | Reads rows from a Google Sheets sheet. |
| Row/Column | Append or Insert Rows in Sheet | Appends or inserts one or more new rows of data into a specified range. |
| Row/Column | Append or Update Row in Sheet | Appends a new row to the end of the sheet, or updates a specific row by row number. |
| Row/Column | Update Row in Sheet | Updates an existing row in a Google Spreadsheet. |
| Cell | Update Cell | Updates the value of a single cell in a Google Sheets spreadsheet. |
Operation Details
Create Spreadsheets
Creates a new Google Spreadsheet with the given title and optional sheet data provided as a JSON or CSV formatted string.
Input Parameters:
- Title: The title of the spreadsheet. Maximum 255 characters. Supports Unicode characters. Duplicate titles are allowed (Google Sheets will not prevent creating multiple spreadsheets with the same name). Example: "2024 Q1 Sales Report"
Options:
- SheetData: Advanced Parameter: Sheet data as a JSON or CSV formatted string. JSON Format (Recommended): [["Name", "Age", "City"], ["Alice", "25", "Beijing"], ["Bob", "30", "Shanghai"]] CSV Format: `Name,Age,City
Alice,25,Beijing
Bob,30,Shanghai` ⚠️ Important: When passing JSON, ensure proper escaping of quotes. Leave empty to create a blank spreadsheet.
Output:
- SpreadsheetId (string): The unique ID of the created spreadsheet. Use this ID for subsequent operations such as updating cells, adding sheets, or deleting the spreadsheet. Example: "1_qnOlmqBzJe-2v5HlqKMVlkOAgR576ryJTPKjwbCY2I"
- SpreadsheetUrl (string): The web URL of the created spreadsheet. Users can open this URL in a browser to view and edit the spreadsheet. Example: "https://docs.google.com/spreadsheets/d/1_qnOlmqBzJe-2v5HlqKMVlkOAgR576ryJTPKjwbCY2I/edit"
- OriginalStatusCode (number): The original HTTP status code returned by the Google Sheets API. Default 0 means the request did not reach upstream (e.g., timeout). Use for debugging. Common values: 200/201=Success, 400=Bad Request, 401=Unauthorized, 403=Forbidden, 404=Not Found.
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions.
- ErrorMessage (string): Error message if an error occurs; empty string if successful.
Delete Spreadsheet
WARNING: Permanently deletes the specified Google Sheets spreadsheet. This action cannot be undone. Deleted spreadsheets are moved to Google Drive Trash and will be permanently removed after 30 days.
Input Parameters:
- SpreadsheetId: The unique identifier of the Google Sheets spreadsheet. How to get it: 1. Open your spreadsheet in Google Sheets 2. Copy the ID from the URL: https://docs.google.com/spreadsheets/d/{SpreadsheetId}/edit 3. Or use the 'List Spreadsheets' action to find it. Example: "1BolBXAqAZi06f-v3_3fTREUs25KV0GOuxhapP3Gb17Q"
Output:
- Deleted (bool): Whether the deleted operation was successful, true for success, false for failure
- OriginalStatusCode (number): The original HTTP status code returned by the upstream API. Default 0 means the request did not reach upstream (e.g., timeout). Use for debugging.
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions.
- ErrorMessage (string): Error message if an error occurs; empty string if successful.
Create Sheet
Create a new worksheet (sheet) within an existing Google Sheets document. Important: If a sheet with the same title already exists, the API will return an error (400 Bad Request). Consider using a unique naming convention (e.g., append timestamp) to avoid conflicts.
Input Parameters:
- SpreadsheetId: The unique identifier of the Google Sheets document. You can find it in the spreadsheet URL: https://docs.google.com/spreadsheets/d/{SpreadsheetId}/edit. Example: '1BolBXAqAZi06f-v3_3fTREUs25KV0GOuxhapP3Gb17Q' (40+ characters, alphanumeric). You can also obtain it via the 'List Spreadsheets' or 'Search Spreadsheets' action.
- SheetTitle: The display name for the new worksheet (tab) within the spreadsheet. Must be unique within the same spreadsheet. Maximum length: 100 characters. Special characters allowed except: [ ] * ? : \ / Example: 'Q1 Sales Data', 'Customer List 2024'
Output:
- SheetCreated (bool): Whether the sheet was successfully created. Returns true only when StatusCode=200 and the API response contains a valid sheetId. Returns false in all error scenarios (parameter validation failure, API error, network timeout, etc.).
- SheetId (string): The unique numeric ID of the created sheet (returned as string). Example: '1204902762'. This ID can be used in subsequent operations to reference this specific sheet within the spreadsheet.
- OriginalStatusCode (number): The original HTTP status code returned by the upstream API. Default 0 means the request did not reach upstream (e.g., timeout). Use for debugging.
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions.
- ErrorMessage (string): Error message if an error occurs; empty string if successful.
Delete Sheet
WARNING: This operation permanently deletes the sheet and cannot be undone. Please ensure you have a backup before proceeding. | Delete a sheet from a Google Sheets spreadsheet by name.
Input Parameters:
- SpreadsheetId: The unique identifier of the Google Sheets spreadsheet. You can find it in the spreadsheet URL: https://docs.google.com/spreadsheets/d/{SpreadsheetId}/edit. Example: 1BolBXAqAZi06f-v3_3fTREUs25KV0GOuxhapP3Gb17Q
- SheetName: The name of the sheet (tab) to delete. This is the name displayed at the bottom of the spreadsheet, such as 'Sheet1', 'Sales Data', etc. Case-sensitive. If the sheet does not exist, the operation will fail with an error.
Output:
- SheetDeleted (bool): Whether the deleted operation was successful, true for success, false for failure
- OriginalStatusCode (number): The original HTTP status code returned by the upstream API. Default 0 means the request did not reach upstream (e.g., timeout). Use for debugging.
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions.
- ErrorMessage (string): Error message if an error occurs; empty string if successful.
Clear Sheet
Clears all data in the specified range of a Google Sheets spreadsheet.
Input Parameters:
- SpreadsheetId: The unique identifier of the Google Sheets spreadsheet. You can find this ID in the spreadsheet URL: https://docs.google.com/spreadsheets/d/{SpreadsheetId}/edit.Example: "1BolBXAqAZi06f-v3_3fTREUs25KV0GOuxhapP3Gb17Q"
- RangeName: The range of cells to clear, in A1 notation. Format: SheetName!StartCell:EndCell. Syntax Rules: - Sheet name: Use single quotes if the name contains spaces or special characters (e.g., 'My Sheet'!A1:Z1000) - Range: Specify start and end cells (e.g., A1:Z1000) - Entire sheet: Use only the sheet name (e.g., Sheet1) to clear all data in that sheet - Named ranges: Supported (e.g., MyNamedRange). Examples: - Clear specific range: "Sheet1!A1:Z1000" - Clear entire sheet: "Sheet1" - Sheet with spaces: "'Sales Data'!A1:D100" - Multiple sheets not supported in a single call
Output:
- Cleared (bool): A boolean value indicating whether the data in the specified range was successfully cleared. Returns true if the operation completed without an API-level error, meaning the cells were emptied. Returns false if an error occurred during the clearing process
- ClearedRange (string): The actual range that was cleared, returned by Google Sheets API. This may differ from the input RangeName if the API normalizes the range notation. For example: - Input: "sheet1" → Output: "'sheet1'!A1:Z1000" - Input: "Sheet1!A:Z" → Output: "Sheet1!A1:Z1000" Use this field to confirm the exact range that was affected.
- OriginalStatusCode (number): The original HTTP status code returned by Google Sheets API. Default 0 means the request did not reach upstream (e.g., timeout). Use for debugging.
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions.
- ErrorMessage (string): Error message if an error occurs; empty string if successful.
Delete Rows or Columns
WARNING: This action permanently deletes rows or columns from the sheet. Deleted data can only be recovered through Google Sheets version history (File > Version history > See version history). Use cases: - Remove empty rows after data import - Delete obsolete columns from template sheets - Clean up test data in bulk. Note: Deleting rows will shift all data below upward, which may break formula references. Deleting columns may affect pivot tables and charts.
Input Parameters:
- SpreadsheetId: The ID of the Google Sheets document. How to get it: 1. Open your Google Sheets document in browser 2. Copy the ID from URL: https://docs.google.com/spreadsheets/d/{SpreadsheetId}/edit Example: If URL is "https://docs.google.com/spreadsheets/d/1BolBXAqAZi06f-v3_3fTREUs25KV0GOuxhapP3Gb17Q/edit", then SpreadsheetId is "1BolBXAqAZi06f-v3_3fTREUs25KV0GOuxhapP3Gb17Q" Format: 44-character alphanumeric string
- SheetId: The target sheet's ID (not the sheet name). How to get it: Method 1 (Recommended): Use "Get Sheet Properties" action to retrieve all sheet IDs Method 2 (Manual): 1. Open the sheet in browser 2. Press F12 to open Developer Tools 3. Switch to the target sheet tab 4. In URL, find "gid={SheetId}" Example: "...edit#gid=981584951" → SheetId is 981584951 Format: Integer (e.g., 0, 981584951) Note: The first sheet's ID is usually 0.
- Dimension: The dimension to delete. Must be exactly "ROWS" or "COLUMNS" (case-sensitive, all uppercase). Business impact: - ROWS: Deletes entire rows. All data below will shift upward. ⚠️ May break formula references that use absolute row numbers (e.g., A$5). - COLUMNS: Deletes entire columns. All data to the right will shift leftward. ⚠️ May affect pivot tables, charts, and named ranges. Example values: "ROWS", "COLUMNS" Invalid values: "rows", "Rows", "ROW", "COLUMN" (will return validation error)
- StartIndex: The starting index (inclusive) for deletion. Index starts from 0. Examples: - To delete the 1st row: StartIndex=0, EndIndex=1 - To delete the 2nd row: StartIndex=1, EndIndex=2 - To delete rows 3-5: StartIndex=2, EndIndex=5 Note: Row/column numbers in Google Sheets UI start from 1, but API indices start from 0.
- EndIndex: The ending index (exclusive) for deletion. Must be greater than StartIndex. Examples: - To delete 1 row starting from index 0: EndIndex=1 (deletes index 0 only) - To delete 3 rows starting from index 2: EndIndex=5 (deletes indices 2, 3, 4) Formula: Number of rows/columns to delete = EndIndex - StartIndex
Output:
- Deleted (bool): Indicates whether the rows or columns were successfully deleted. Value logic: - true: Deletion succeeded (StatusCode=200 and ErrorMessage is empty) - false: Deletion failed (StatusCode=-1/500, or StatusCode=200 but ErrorMessage is not empty) Note: Always check ErrorMessage for failure details when Deleted=false.
- OriginalStatusCode (number): "The original HTTP status code returned by the upstream API. Default value is 0. Use this for debugging and troubleshooting. 0 means the request did not reach the upstream API (e.g., network timeout). 200/201/204 means success. 4xx means client error (e.g., 400 Bad Request, 404 Not Found). 5xx means server error.
- StatusCode (number): Operation status code: - 200: Success. The upstream API request completed successfully. Check ErrorMessage for business-level errors. - -1: Parameter validation error. One or more input parameters are invalid or missing. - 500: System error. Network timeout (>30s), connection failure, or response parsing error.
- ErrorMessage (string): Error message if an error occurs; empty string if successful.
Get Rows in Sheet
Read rows from a Google Sheets sheet. Useful for: - Extracting data for processing in workflows - Reading configuration or lookup tables - Batch data retrieval. Tip: Use 'RowRange' to limit data volume and improve performance. For large sheets, consider reading in batches (e.g., '1:100', '101:200').
Input Parameters:
- SpreadsheetId: The unique identifier of the Google Sheets document. You can find this ID in the spreadsheet URL: https://docs.google.com/spreadsheets/d/{SPREADSHEET_ID}/edit. For example, if the URL is 'https://docs.google.com/spreadsheets/d/1BolBXAqAZi06f-v3_3fTREUs25KV0GOuxhapP3Gb17Q/edit', the SpreadsheetId is '1BolBXAqAZi06f-v3_3fTREUs25KV0GOuxhapP3Gb17Q'.
- SheetName: The name of the sheet to read from. This is the tab name visible at the bottom of your Google Sheets document. Sheet names are case-sensitive. Example: 'Sheet1', 'Sales Data', '2024 Q1'
Options:
- RowRange: Specify the line number or line range, for example, '3' (indicating line 3) or '2:5' (indicating lines 2 to 5). If it is empty, read all rows.
Output:
- Rows (string): A string in two-dimensional array format, where each element is a row of data (string array). Structure: [["A1", "B1", "C1"], ["A2", "B2", "C2"]]. If the specified row range is empty, return all rows.
- OriginalStatusCode (number): The original HTTP status code returned by the upstream API. Default value is 0. Use this for debugging and troubleshooting. 0 means the request did not reach the upstream API (e.g., network timeout). 200/201/204 means success. 4xx means client error (e.g., 400 Bad Request, 404 Not Found). 5xx means server error.
- StatusCode (number): HTTP status code of the API response, -1 for parameter errors, 500 for exceptions.
- ErrorMessage (string): Error message if an error occurs; empty string if successful.
Append or Insert Rows in Sheet
Appends or inserts one or more new rows of data into a specified range in a Google Sheets spreadsheet, with the option to specify an insertion index.
Input Parameters:
- SpreadsheetId: The unique identifier of the Google Sheets spreadsheet. How to get it: 1. Open your spreadsheet in Google Sheets 2. Copy the ID from the URL: https://docs.google.com/spreadsheets/d/{SpreadsheetId}/edit 3. Or use the 'List Spreadsheets' action to find it. Example: "1BolBXAqAZi06f-v3_3fTREUs25KV0GOuxhapP3Gb17Q"
- RangeName: The range where data will be appended, in A1 notation (e.g., 'Sheet1!A:D'). Behavior: - Data is appended to the first empty row after the specified range - If range is 'Sheet1!A:D', data fills columns A through D - If range is 'Sheet1', data fills all columns starting from A Sheet name rules: - If sheet name contains spaces or special characters, wrap it in single quotes: 'My Sheet'!A:D - Default sheet name is 'Sheet1' Example: "Sheet1!A:D"
- RowValues: A JSON formatted string representing the row(s) of data to append. Data must be serialized into a string to support both single and multiple row appends. Example for a single row: '["Value A", "Value B", 123]' Example for multiple rows: '[["Row1 A", "Row1 B"], ["Row2 A", "Row2 B"]]'
Options:
- InsertRow: ⚠️ NOTE: Insert operation always starts from column A, ignoring the column range in RangeName. Optional. Specifies the 0-based row index where new data rows will be inserted. When this parameter is provided and is a valid non-negative integer, the operation will perform an insertion instead of appending data. Existing rows from the specified InsertRow index onwards will be shifted downwards to accommodate the new rows. If this parameter is omitted or set to null/None, the operation will default to appending data, adding new rows at the end of the existing table in the specified RangeName.
Output:
- Appended (bool): Indicates whether the overall Google Sheets operation (either appending or inserting rows) was successfully initiated and processed by the Google Sheets API without any immediate system-level or API-level errors that prevent the operation from being attempted.
- Updates (object): Detailed information about the append operation returned by Google Sheets API. Key fields: - spreadsheetId (string): The ID of the updated spreadsheet - tableRange (string): The range where data was appended - updates (object): Update statistics - updatedRows (number): Number of rows added - updatedCells (number): Number of cells filled - updatedRange (string): The exact range that was updated. Example: {"spreadsheetId": "1BolB...", "updates": {"updatedRows": 1, "updatedCells": 4}}
- OriginalStatusCode (number): The original HTTP status code returned by the Google Sheets API. Default value is 0. Use this for debugging and troubleshooting. - 0: The request did not reach the upstream API (e.g., network timeout, connection refused). - 200: Upstream API returned success. - 400: Bad request (e.g., invalid range format). - 403: Permission denied (e.g., service account has no access to the spreadsheet). - 404: Spreadsheet not found.
- StatusCode (number): Operation status code: - 200: Success. The upstream API request completed successfully. Check ErrorMessage for business-level errors. - -1: Parameter validation error. One or more input parameters are invalid or missing. - 500: System error. Network timeout, connection failure, or response parsing error. The operation may be retried.
- ErrorMessage (string): Error message if an error occurs; empty string if successful.
Append or Update Row in Sheet
Append a new row to the end of the sheet, or update a specific row by row number. Use RowIndex=null for append, or specify a row number (e.g., 5) to update that row. Update Strategy: Only the columns specified in RowData will be updated (PATCH behavior). Columns not included in RowData will remain unchanged. For example, if RowData has 3 elements, only columns A, B, C will be updated; columns D onwards will keep their original values. This action does NOT automatically detect duplicates.
Input Parameters:
- SpreadsheetId: The unique ID of the Google Spreadsheet. You can find this ID in the spreadsheet URL: https://docs.google.com/spreadsheets/d/{SpreadsheetId}/edit. Example: 1BolBXAqAZi06f-v3_3fTREUs25KV0GOuxhapP3Gb17Q
- SheetName: The name of the sheet (tab) within the spreadsheet. Case-sensitive. If the sheet does not exist, the API will return an error. Example: Sheet1, Sales Data, 2024-Q1
- RowData: An array of values to append or update. Each element corresponds to a column in the sheet (A, B, C, ...). Important: When updating, only the columns covered by RowData will be modified; other columns in the row will remain unchanged. Example: ["John Doe", "john@example.com", "Sales"] will fill/update columns A, B, C only.
Options:
- RowIndex: The row number to update (1-based index, matching Google Sheets UI). For example, RowIndex=1 updates the first row (header row), RowIndex=2 updates the second row. Leave empty (null) to append a new row at the end. Example: 5
Output:
- Appended (bool): Whether the append operation was successful, true for success, false for failure
- Updated (bool): Whether the update operation was successful, true for success, false for failure
- UpdatedRange (string): The range returned by the update operation , returned if the update was successful, otherwise an empty string.
- OriginalStatusCode (number): The original HTTP status code returned by the upstream API. Default value is 0. Use this for debugging and troubleshooting. - 0: The request did not reach the upstream API (e.g., network timeout, connection refused). - 200: Upstream API returned success. - 4xx: Client error from upstream (e.g., 400 Bad Request, 401 Unauthorized, 404 Not Found). - 5xx: Server error from upstream.
- StatusCode (number): Operation status code: 200=Success (check ErrorMessage for business errors), -1=Parameter validation error, 500=System error (may retry).
- ErrorMessage (string): Error message if an error occurs; empty string if successful.
Update Row in Sheet
Updates an existing row in a Google Spreadsheet. This operation only updates rows that already exist.
Input Parameters:
- SpreadsheetId: The unique identifier for Google Sheets (Spreadsheet ID). Acquisition method: -Open the Google Sheets table and copy the ID from the browser address bar in URL format: https://docs.google.com/spreadsheets/d/ {SpreadsheetId}/edit -For example: 1BalBXAqAZi06f-v3_3fTREUs25KV0GOuxhapP3Gb17Q` ⚠️ Note: -Must be a complete ID (not a table name) - The service account must have editing permissions for the table
- SheetName: The name of the sheet (tab) where the row will be updated. **What is a Sheet? A Google Spreadsheet can contain multiple sheets (tabs at the bottom). Each sheet has a name like "Sheet1", "Sales Data", "Q1 Report", etc. How to find it: 1. Open your Google Spreadsheet 2. Look at the tabs at the bottom of the page 3. Use the exact name of the tab you want to update Example: If your tab is named "Employee List", pass "Employee List" ⚠️ Note: Sheet names are case-sensitive. "Sheet1" and "sheet1" are different.
- RowIndex: The row number to update (1-based indexing, must be a positive integer). Counting Rules: - Row 1 = Header row (first row) - Row 2 = First data row - Row 3 = Second data row - And so on... Example:To update the second data row, pass 2 Important Notes:- Must be an existing row (cannot exceed current row count) - Does not support 0 or negative numbers - To update the header row, pass 1 Common Errors: - [INVALID] 0 → Row numbers start from 1 - [INVALID] 1000 → If the sheet only has 100 rows, this will fail - [VALID] 2 → Updates the first data row (second row overall)
- UpdateValues: The new values to update. If a list or dict, it will be converted to JSON format.
Output:
- Results (object): The update result object returned by the Google Sheets API. When successful, the following fields are included: Core fields: -SpreadsheetId (string): The ID of the spreadsheet - updatedRange (string): The actual range of updated cells, formatted as' Sheet1 '! A1:C1 - updatedRows (number): The number of rows updated (usually 1) - updatedFlumns (number): The number of columns updated (equal to the number of values passed in) - updatedCells (number): Total number of updated cells ** Example: ``json { "spreadsheetId": "1BolBXAqAZi06f-v3_3fTREUs25KV0GOuxhapP3Gb17Q", "updatedRange": "'Sheet1'!A2:C2", "updatedRows": 1, "updatedColumns": 3, "updatedCells": 3 } `` Note: - When the Status Code is not 200 or the Error Message is not empty, this field is an empty object {}
- OriginalStatusCode (number): The original HTTP status code returned by the upstream API. Default 0 means the request did not reach upstream (e.g., timeout). Use for debugging.
- StatusCode (number): Operation status code: - 200: Success. The upstream API request completed successfully. Check ErrorMessage for business-level errors. - -1: Parameter validation error. One or more input parameters are invalid or missing. - 500: System error. Network timeout, connection failure, or response parsing error. The operation may be retried."
- ErrorMessage (string): Error message if an error occurs; empty string if successful.
Update Cell
Update the value of a single cell in a Google Sheets spreadsheet. This operation will overwrite the existing content in the target cell.
Input Parameters:
- SpreadsheetId: The unique ID of the spreadsheet. You can find it in the URL between '/d/' and '/edit'. Example: In 'https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit', the ID is '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms'.
- Cell: The target cell in A1 notation. Format: 'SheetName!ColumnRow'. Examples: 'Sheet1!A1' (first cell), 'Data!C10' (column C, row 10), 'Summary!AA100' (column AA, row 100).
- Value: The string content to be written into the specified cell. This operation will entirely overwrite any existing data or formula previously present in that cell.
Output:
- SpreadsheetId (string): The ID of the spreadsheet where the update occurred. This value is the same as the input SpreadsheetId parameter.
- UpdatedRange (string): The range of cells that were actually updated, in A1 notation (e.g., 'Sheet1!B2'). This may differ from the input Cell if the API normalized the range format.
- UpdatedRows (number): The total number of rows that were affected by the update. For a single cell update operation, this value will typically be 1, indicating that one row containing the target cell was modified.
- UpdatedColumns (number): The total number of columns that were affected by the update. For a single cell update operation, this value will typically be 1, indicating that one column containing the target cell was modified.
- UpdatedCells (number): The total count of individual cells that had their values updated as a result of the operation. For a single cell update, this will be 1, confirming that only the designated cell was changed.
- OriginalStatusCode (number): The original HTTP status code returned by Google Sheets API. Default 0 means the request did not reach upstream (e.g., timeout). Use for debugging.
- StatusCode (number): Operation status code: 200=Success (check ErrorMessage for business errors), -1=Parameter validation error, 500=System error (may retry).
- ErrorMessage (string): A description of the error. Returns an empty string if the operation was successful.
5. Example Usage
This section will guide you through creating a simple workflow to create a new Google Spreadsheet using the Google Sheets node.
Let's walk through the process of setting up a workflow that creates a new spreadsheet with some initial data.
Workflow Overview: This example workflow consists of Start -> Create SpreadSheets -> Answer.
Step-by-Step Guide:
- Add Tool Node:
- In the workflow canvas, click the "+" button to add a new node.
- In the popup panel, select the "Tools" tab.
- Find and select Google Sheets from the tool list.
- In the list of supported operations for Google Sheets, click to select Create SpreadSheets, which will add a corresponding node to the canvas.
- Configure Node:
- Click on the newly added Create SpreadSheets node, and the configuration panel will expand on the right side.
- Credentials Configuration: At the top of the panel, find the credentials field. Click the dropdown menu and select your pre-configured Google Sheets credentials.
- Parameter Configuration: Fill in the input parameters in detail:
- For the Title parameter: Enter a title for your new spreadsheet, such as "My Budget Tracker" or "Sales Report 2024". This will be the name displayed in your Google Drive.
- For the SheetData parameter (optional): If you want to populate the spreadsheet with initial data, provide it as a JSON or CSV formatted string. For example, you could enter: [["Name", "Email", "Phone"], ["John Doe", "john@email.com", "555-1234"]] to create a simple contact list.
- Run and Verify:
- Once all required parameters are correctly filled, the error indicators in the upper right corner of the workflow canvas will disappear.
- Click the "Test Run" button in the upper right corner of the canvas to execute the workflow.
- After successful execution, you can click the log icon in the upper right corner to view the detailed input and output of the node, verifying that the operation was successful.
Final Workflow Summary: After completing the above steps, your entire workflow is configured. Click "Test Run" and a new spreadsheet will be successfully created in your Google Sheets with the specified title and any initial data you provided.
6. FAQs
Q: Why am I getting a 401/403 error when trying to access Google Sheets?
A: This typically indicates an authentication or authorization issue. Please check the following:
- Ensure your Google Sheets API credentials are correctly configured in GoInsight.
- Verify that the Google Cloud project has the Google Sheets API enabled.
- Check that the service account has the necessary permissions to access the target spreadsheet.
- Make sure the spreadsheet is shared with the service account email if using service account authentication.
Q: What format should I use for the SheetData parameter when creating spreadsheets?
A: The SheetData parameter accepts either JSON or CSV formatted strings. For JSON format, use a nested array structure like [["Header1", "Header2"], ["Value1", "Value2"]]. For CSV format, use comma-separated values with line breaks, such as "Header1,Header2\nValue1,Value2".
Q: How do I specify cell ranges in Google Sheets operations?
A: Use the standard A1 notation for cell ranges. Examples include:
- Sheet1!A1:C10 - refers to cells A1 through C10 on Sheet1
- Sheet1!A:A - refers to the entire column A on Sheet1
- Sheet1!1:1 - refers to the entire first row on Sheet1
- A1:C10 - refers to cells A1 through C10 on the default sheet
Q: What happens if I try to delete a sheet that doesn't exist?
A: The operation will fail and return an error message indicating that the sheet was not found. Always verify the sheet name exists before attempting to delete it. You can use the "Get Rows in Sheet" operation to verify sheet existence first.
7. Official Documentation
For more detailed information about the Google Sheets API capabilities and advanced usage, please refer to the Google Sheets Official API Documentation.
Leave a Reply.