1. Overview
Microsoft Excel is a powerful spreadsheet application developed by Microsoft, widely used for organizing, analyzing, and visualizing data. It is a core component of the Microsoft 365 suite of productivity software.
With the GoInsight Microsoft Excel node, you can seamlessly integrate spreadsheet automation into your workflows. This allows you to manage the entire lifecycle of your Excel files stored in OneDrive, from creation to detailed data manipulation. Key capabilities include:
- Workbook Management: Create, list, and delete entire Excel workbook files in your OneDrive.
- Worksheet Operations: Add, delete, list, and clear worksheets within a specific workbook.
- Data Handling: Read data from sheets and tables, append new data to sheets, and update existing cell ranges.
- Table Management: Create and delete tables within a worksheet, manage their columns and rows, and convert them back to standard ranges.
2. Prerequisites
Before using this node, you need to have a valid Microsoft account with a subscription that includes OneDrive access (e.g., Microsoft 365). You may also need appropriate permissions within your Microsoft organization to grant API access to GoInsight for managing files.
3. Credentials
For a detailed guide on how to obtain and configure your credentials, please refer to our official documentation: Credentials Configuration Guide.
4. Supported Operations
Summary
This node supports operations on Workbooks, Sheets, Tables, and specific Data ranges.
| Resource | Operation | Description |
|---|---|---|
| Workbook | Create a Workbook | Create a new Excel workbook in user's OneDrive. |
| Workbook | Get Workbooks | Retrieve a list of Excel workbooks from the user's OneDrive. |
| Workbook | Delete Workbook | Delete a specified Excel workbook from user's OneDrive. |
| Sheet | Add a Sheet to a Workbook | Add a new worksheet to a specified Excel workbook. |
| Sheet | Get Sheets | Retrieve sheet list from an Excel workbook. |
| Sheet | Delete Sheet | Delete a specified worksheet from an Excel workbook. |
| Sheet | Copy Sheet to Workbook | Copy an entire worksheet from one Excel workbook to another. |
| Sheet | Clear a Sheet | Clear content from a specified worksheet in an Excel workbook. |
| Sheet Data | Get Rows from Sheet | Retrieve row data from a specified worksheet. |
| Sheet Data | Get Rows from Sheet with Range | Gets the range object specified by the address or name. |
| Sheet Data | Append Data to Sheet | Append data to a specified worksheet in an Excel workbook. |
| Sheet Data | Update Sheet | Update properties of an Excel worksheet. |
| Sheet Data | Append or Update Sheet | Append or update row data in a worksheet. |
| Table | Create a Table | Create a new table in a specified worksheet. |
| Table | Delete a Table | Delete a specified table from an Excel workbook. |
| Table | Convert to Range | Convert a table to a normal cell range in an Excel workbook. |
| Table Data | Get Rows | Retrieve row data from a specified table in an Excel workbook. |
| Table Data | Append Rows to Table | Append rows to a specified table in an Excel workbook. |
| Table Data | Get Columns | Retrieve column data from a specified table in an Excel workbook. |
| Table Data | Lookup a Column | Lookup detailed information about a specific column in an Excel table. |
Operation Details
Create a Workbook
Create a new Excel workbook in user's OneDrive using Microsoft Graph API. Requires file name parameter. Returns new workbook metadata including ID, name, and web URL.
Input Parameters:
- FileName: Name for the new Excel workbook. The .xlsx extension will be added automatically if not provided. Example: 'quarterly_report' will create 'quarterly_report.xlsx'. File name should not exceed 255 characters and cannot contain special characters: \ / : * ? " < > |
Output:
- Workbook (object): The newly created workbook metadata object containing: 'id' (unique identifier), 'name' (filename with .xlsx), 'webUrl' (direct link to access workbook), 'createdDateTime' (creation timestamp in ISO 8601 format), 'lastModifiedDateTime' (last modified timestamp)
- StatusCode (number): HTTP status code: 200 (success), 400 (invalid parameters), 401 (authentication failed), 409 (file already exists), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. For successful requests, this field will be empty. For failures, contains actionable error information including the original API error details.
Get Workbooks
Retrieve a list of Excel workbooks from the user's OneDrive using Microsoft Graph API. This operation fetches all .xlsx files with their IDs, names, and web URLs. Requires a valid access token with delegated permissions. Returns array of workbook objects containing id, name, and webUrl fields along with status code and error message.
Options:
- Limit: Optional maximum number of workbooks to return. Use this for pagination or to limit results. Example: 10 (returns maximum 10 workbooks). Set to 0 or leave empty to retrieve all available workbooks without limit.
Output:
- Workbooks (object-array): Array of workbook objects found in user's OneDrive. Each object contains: id (unique workbook identifier), name (filename, e.g., 'MyFile.xlsx'), webUrl (direct link to open in Excel), createdDateTime, modifiedDateTime, and other file metadata. Empty array if no Excel files found or operation failed (check ErrorMessage and StatusCode).
- StatusCode (number): HTTP status code: 200 (workbooks retrieved successfully), 400 (invalid parameters), 401 (authentication failed - token expired), 403 (permission denied - requires Files.Read.All scope), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. Empty for successful operations. For failures, contains actionable information such as: 'Access token expired', 'Permission denied', 'Rate limited', etc.
Delete Workbook
Delete a specified Excel workbook from user's OneDrive using Microsoft Graph API. Requires user ID and workbook ID parameters. Returns success status, status code, and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook to delete. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by Get Workbooks action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'. ⚠️ WARNING: This action permanently deletes the ENTIRE workbook file - all sheets, data, and formatting will be lost.
Output:
- Success (bool): Boolean flag indicating whether the workbook deletion was successful. True = entire workbook file permanently deleted and cannot be recovered; False = operation failed (check ErrorMessage and StatusCode for details)
- StatusCode (number): HTTP status code: 204 (workbook deleted successfully - all sheets and data permanently removed), 400 (invalid parameters), 401 (authentication failed - token expired), 404 (workbook not found - already deleted or invalid ID), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. Empty for successful operations. For failures, contains actionable information such as: 'Workbook not found', 'Access token expired', 'Rate limited', etc. CRITICAL: Deletion is permanent and cannot be undone.
Add a Sheet to a Workbook
Add a new worksheet to a specified Excel workbook using Microsoft Graph API. Requires workbook ID, and sheet name parameters. Returns new sheet object with id, name, and position along with status code and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by List Files action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40-...' or 'A1B2C3D4E5F6'
- SheetName: The name for the new worksheet to add to the workbook. Must be unique within the workbook. Sheet names can contain letters, numbers, spaces, and most special characters except: \ / : * ? " < > |. Maximum length is 31 characters. Example: 'Sales Data' or 'Q4_2024'
Output:
- NewSheet (object): The newly created worksheet metadata object containing: 'id' (unique sheet identifier), 'name' (worksheet name), 'position' (zero-based index position within the workbook). Example: {'id': 'wsheet123', 'name': 'Sales Data', 'position': 2}
- StatusCode (number): HTTP status code: 200 (success), 400 (invalid parameters), 401 (authentication failed), 404 (workbook not found), 409 (sheet name already exists), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. For successful requests, this field will be empty. For failures, contains actionable error information including the original API error details. Common errors include: 'Duplicate sheet name', 'Workbook not found', 'Authentication failed'.
Get Sheets
Retrieve sheet list from an Excel workbook using Microsoft Graph API. Requires workbook ID parameter. Returns sheet data array with id, name and position, status code, and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by Get Workbooks action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'
Output:
- Sheets (object-array): Array of worksheet objects found in the workbook. Each object contains: id (unique worksheet identifier), name (worksheet name, e.g., 'Sheet1', 'Data'), position (zero-based index indicating sheet order in the workbook), and other metadata. Empty array if no sheets found or operation failed (check ErrorMessage and StatusCode).
- StatusCode (number): HTTP status code: 200 (sheets retrieved successfully), 400 (invalid parameters), 401 (authentication failed - token expired), 404 (workbook not found), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. Empty for successful operations. For failures, contains actionable information such as: 'Workbook not found', 'Access token expired', 'Rate limited', etc.
Delete Sheet
Delete a specified worksheet from an Excel workbook using Microsoft Graph API. Requires workbook ID, and sheet name parameters. Returns success status, status code, and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook containing the sheet to delete. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by Get Workbooks action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'
- SheetName: The name of the worksheet to delete. This is the sheet tab name visible at the bottom of the Excel file (case-sensitive). Example: 'Sheet1', 'Sales Data', 'Archive'. You can obtain sheet names from Get Sheets action. Warning: This action permanently deletes the sheet and cannot be undone.
Output:
- Success (bool): Boolean flag indicating whether the sheet deletion was successful. True = worksheet deleted successfully and cannot be recovered; False = operation failed (check ErrorMessage and StatusCode for details)
- StatusCode (number): HTTP status code: 204 (sheet deleted successfully), 400 (invalid parameters), 401 (authentication failed - token expired), 404 (worksheet/workbook not found), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. Empty for successful operations. For failures, contains actionable information such as: 'Worksheet not found', 'Access token expired', 'Rate limited', etc. Note: Deletion is permanent and cannot be undone.
Copy Sheet to Workbook
Copy an entire worksheet (including formulas, formatting, and cell styles) from one Excel workbook to another using Microsoft Graph API. Supports renaming the copied sheet and optionally preserving cell formatting. Handles rate limiting, timeouts, and connection errors automatically. NOTE: The source and target workbooks must be different files. For very large sheets (>5000 rows), operation may take longer or fail due to timeout - consider splitting data into multiple sheets. Cell formulas are preserved when IncludeFormatting is set to 'true'. Refer to Microsoft Graph API documentation for WorkbookId and sheet name requirements.
Input Parameters:
- SourceWorkbookId: [Required] Unique identifier (drive item ID) of the source Excel workbook containing the sheet to copy.
How to obtain:
- From the 'id' field of Create a Workbook action output
- From the file details returned by Get Workbooks action
- Extracted from OneDrive/SharePoint URL parameter
Format: b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6 (Base64-encoded drive item ID)
- SourceSheetName: [Required] Name of the worksheet to copy from the source workbook (case-sensitive).
Note: Sheet name must exactly match the tab name visible at the bottom of the Excel file.
How to obtain: Use Get Sheets action to list all available worksheets
Examples: 'Sheet1', 'Sales Data', 'Report'
- TargetWorkbookId: [Required] Unique identifier (drive item ID) of the destination workbook where the sheet will be copied to.
Important: Target workbook must be different from the source workbook (cannot copy to the same file).
How to obtain: Same method as SourceWorkbookId
Format: b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6
- NewSheetName: Name for the new sheet in the target workbook. If omitted or empty, defaults to the source sheet name.Constraints: Sheet name max 31 characters and must be unique within the target workbook. Supports mixed English/Chinese characters.Examples: 'Imported Data', 'Q4 Report'
Options:
- IncludeFormulas: [Optional] Whether to copy cell formulas and number formatting along with data.
Values:
- true (recommended): Preserves formulas and basic number formats (date, currency, etc.)
- false: Copies only calculated values without formulas
⚠️ Limitation: Advanced formatting (font colors, borders, conditional formatting) is NOT supported by Microsoft Graph API and must be manually reapplied
- CopyRange: [Optional] Specify the range of cells to copy from the source sheet. If empty, the entire used range will be copied.
Purpose: Use this parameter when the source sheet contains multiple tables and you only want to copy specific data
Format: Excel range notation, e.g., 'A1:C10', 'D8:F14'
Examples:
- 'A1:E10' - Copy rows 1-10, columns A-E
- 'D8:F14' - Copy only a specific product table
- '' (empty) - Copy all used data
Output:
- CopiedSheet (object): Object containing details of the successfully copied sheet:
- id (string): Unique sheet ID in the target workbook
- name (string): Actual sheet name used (may be truncated to 31 characters)
- source_sheet (string): Original sheet name from source workbook
- source_workbook_id (string): ID of the source workbook
- target_workbook_id (string): ID of the target workbook
- with_formulas (bool): Whether formulas were copied (true/false)
- source_address (string): Source data range address (e.g., 'D1:L14')
- target_range (string): Excel range address where data was written (e.g., 'D1:L14')
- row_count (number): Number of rows copied
- column_count (number): Number of columns copied
⚠️ Note: Advanced cell formatting (colors, fonts, borders, styles) is NOT preserved by Microsoft Graph API and must be reapplied manually.
- StatusCode (number): HTTP status code: 200 (sheet copied successfully), 400 (invalid parameters, source/target workbooks must be different, or source sheet empty), 401 (authentication failed - token expired), 404 (source sheet/workbook or target workbook not found), 409 (sheet name already exists in target), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Descriptive error message. Empty if StatusCode is 200. Contains actionable information for debugging or retrying the operation.
Clear a Sheet
Clear content from a specified worksheet in an Excel workbook using Microsoft Graph API. Requires workbook ID and sheet name parameters. Optionally accepts range address (defaults to usedRange). Returns success status, status code, and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by Get Workbooks action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'
- SheetName: The name of the worksheet to clear. This is the sheet tab name visible at the bottom of the Excel file (e.g., 'Sheet1', 'Sales Data', 'Q1 Report'). Sheet names are case-sensitive. You can obtain sheet names from Get Sheets action.
Options:
- Range: Excel range address to clear specific cells (optional). Supports formats: 'A1:D10' (rectangular range), 'A:D' (entire columns), '1:10' (entire rows). Leave empty to clear all data in the worksheet (entire used range).
Output:
- Success (bool): Boolean flag indicating whether the clear operation was successful. True = data cleared successfully; False = operation failed (check ErrorMessage and StatusCode for details)
- StatusCode (number): HTTP status code: 200 (data cleared successfully), 400 (invalid parameters or range format), 401 (authentication failed - token expired), 404 (worksheet/workbook not found), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. Empty for successful operations. For failures, contains actionable information such as: 'Worksheet not found', 'Access token expired', 'Rate limited', 'Invalid range format', etc.
Get Rows from Sheet
Retrieve row data from a specified worksheet in an Excel workbook using Microsoft Graph API. Requires workbook ID, and sheet name parameters. Returns row data array with row numbers and values, status code, and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by Get Workbooks action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'
- SheetName: The name of the worksheet within the workbook. This is the sheet tab name visible at the bottom of the Excel file (e.g., 'Sheet1', 'Sales Data', 'Q1 Report'). Sheet names are case-sensitive. You can obtain sheet names from Get Sheets action.
Options:
- Limit: Maximum number of rows to return. Range: 1-10000. Default: 1000. If the worksheet contains fewer rows than this limit, all rows will be returned.
- RangeAddress: Excel range address to retrieve specific cell ranges (optional). Supports formats: 'A1:D10' (specific range), 'A:D' (entire columns), '1:10' (entire rows). Leave empty to return the entire used range of the worksheet.
Output:
- Rows (object-array): Array of row objects from the worksheet. Each row object contains: rowNumber (1-indexed row position in the sheet) and values (array of cell values in that row). Example: [{"rowNumber": 1, "values": ["Name", "Age", "City"]}, {"rowNumber": 2, "values": ["Alice", 30, "NYC"]}]. Empty array if no data found or operation failed (check ErrorMessage and StatusCode).
- StatusCode (number): HTTP status code: 200 (rows retrieved successfully), 400 (invalid parameters), 401 (authentication failed - token expired), 404 (worksheet/workbook not found), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Descriptive error message. Empty if StatusCode is 200. Contains actionable information for debugging or retrying the operation.
Get Rows from Sheet with Range
Gets the range object specified by the address or name.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by Get Workbooks action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'
- SheetName: The name of the worksheet within the workbook. This is the sheet tab name visible at the bottom of the Excel file (e.g., 'Sheet1', 'Sales Data', 'Q1 Report'). Sheet names are case-sensitive. You can obtain sheet names from Get Sheets action.
- RangeName: Excel range address to retrieve specific cells (required for this action). Supports formats: 'A1:D10' (rectangular range), 'A:D' (entire columns), '1:10' (entire rows), 'A1' (single cell). Examples: 'A1:B5' (top-left to bottom-right), 'D:D' (entire D column), '5:10' (rows 5 to 10).
Output:
- Rows (object-array): Array of row objects from the specified range. Each row object contains: rowNumber (1-indexed row position in the retrieved range) and values (array of cell values in that row). Example: [{"rowNumber": 1, "values": ["Name", "Age"]}, {"rowNumber": 2, "values": ["Alice", 30]}]. Empty array if no data found or operation failed (check ErrorMessage and StatusCode).
- StatusCode (number): HTTP status code: 200 (rows retrieved successfully), 400 (invalid parameters or range format), 401 (authentication failed - token expired), 404 (worksheet/workbook not found), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. Empty for successful operations. For failures, contains actionable information such as: 'Invalid range address', 'Worksheet not found', 'Access token expired', 'Rate limited', etc.
Append Data to Sheet
Append data to a specified worksheet in an Excel workbook using Microsoft Graph API. Requires workbook ID, sheet name, and data parameters. Supports JSON or CSV format data. Returns success status, status code, and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by List Files action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'
- SheetName: The name of the worksheet to append data to. Must match an existing sheet in the workbook (case-sensitive). Example: 'Sales Data' or 'Q4_2024'
- Data: The data to append to the sheet. Supports two formats:
Format 1 - JSON Array (RECOMMENDED):
A 2D array where each element is a row of data. Example: [[1,"Alice",100],[2,"Bob",200]]
Format 2 - CSV Text:
Rows separated by newlines, columns separated by commas. Chinese commas (,) are automatically converted to English commas (,). Example: 1,Alice,100
2,Bob,200
The system tries JSON parsing first; if it fails, falls back to CSV parsing.
Options:
- RangAddress: OPTIONAL - Two operation modes:
- Leave EMPTY (Recommended for appending multiple rows): Data will be automatically appended to the next available row after existing data. System accurately calculates the insertion point by parsing the usedRange address field. Correctly handles multiple sequential appends.
- Specify Range (For precise control): Provide Excel range address like 'A5:C10' or 'A1' to write data to a specific location. This will OVERWRITE any existing data in that range. Example: 'A1' (single cell), 'A5:C7' (multi-cell range)
Output:
- Success (bool): Boolean flag indicating whether data was successfully written to the worksheet. True = data appended/updated successfully; False = operation failed (check ErrorMessage and StatusCode for details)
- StatusCode (number): HTTP status code: 200 (data successfully appended), 400 (invalid parameters like malformed data), 401 (authentication failed - token expired), 404 (worksheet/workbook not found), 409 (data range conflict), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. Empty for successful operations. For failures, contains actionable information such as: 'Worksheet not found', 'Access token expired', 'Rate limited', etc. Common errors include data format issues, worksheet name mismatches, and authentication problems.
Update Sheet
Update properties of an Excel worksheet using Microsoft Graph API. Supports updating sheet name and visibility. Requires workbook ID, and sheet name parameters. Returns success status, status code, and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by List Files action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'
- SheetName: The name of the worksheet to update. Must match an existing sheet in the workbook (case-sensitive). Example: 'Sales Data' or 'Q4_2024'
- Data: The data to update. Supports two formats:
Format 1 - JSON Array (RECOMMENDED):
A 2D array where each element is a row of data. Example: [[1,"Alice",100],[2,"Bob",200]]
Format 2 - CSV Text:
Rows separated by newlines, columns separated by commas. Chinese commas (,) are automatically converted to English commas (,). Example: 1,Alice,100
2,Bob,200
The system tries JSON parsing first; if it fails, falls back to CSV parsing.
- RangeAddress: Excel range address where data will be written. This parameter is REQUIRED for Update Sheet operation (used to specify exactly where to update). Supports several formats:
- Single cell: 'A1' (updates one cell)
- Row range: 'A1:D1' (updates cells A1 to D1)
- Multi-row range: 'A1:D5' (updates cells A1 to D5)
- By column letter: 'B2' (updates starting from B2)
- By column index: 'A1' is always valid
Data will overwrite any existing content in the specified range. If your data has fewer rows/columns than the range, remaining cells in the range will be cleared. Example: 'A5:C10' (update range from A5 to C10)
Output:
- Success (bool): Boolean flag indicating whether data was successfully updated. True = data written to the specified range successfully; False = operation failed (check ErrorMessage and StatusCode for details)
- StatusCode (number): HTTP status code: 200 (data successfully updated in specified range), 400 (invalid range address or parameters), 401 (authentication failed - token expired), 404 (worksheet/workbook not found), 409 (range conflict or invalid format), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. Empty for successful operations. For failures, contains actionable information such as: 'Invalid range address', 'Worksheet not found', 'Access token expired', 'Rate limited', etc.
Append or Update Sheet
Append or update row data in a worksheet using Microsoft Graph API. Requires workbook ID, sheet name, data, and range address parameters. Supports JSON or CSV format data. Returns success status, status code, and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by List Files action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'
- SheetName: The name of the worksheet to append/update. Must match an existing sheet in the workbook (case-sensitive). Example: 'Sales Data' or 'Q4_2024'
- Data: The data to append/update. Supports two formats:
Format 1 - JSON Array (RECOMMENDED):
A 2D array where each element is a row of data. Example: [[1,"Alice",100],[2,"Bob",200]]
Format 2 - CSV Text:
Rows separated by newlines, columns separated by commas. Chinese commas (,) are automatically converted to English commas (,). Example: 1,Alice,100
2,Bob,200
The system tries JSON parsing first; if it fails, falls back to CSV parsing.
Options:
- Range: OPTIONAL - Two operation modes:
- Leave EMPTY (Recommended for upsert): Data will be updated if it exists (identified by first column/A column value), or appended as new row if it doesn't exist. This enables upsert (update or insert) behavior using the first column as key.
- Specify Range (For precise control): Provide Excel range address like 'A1:C5' to write data to a specific location. This will OVERWRITE any existing data in that range. Example: 'A1' (single cell), 'A5:C10' (multi-cell range)
Output:
- Success (bool): Boolean flag indicating whether data was successfully appended/updated. True = operation successful; False = operation failed (check ErrorMessage and StatusCode for details)
- StatusCode (number): HTTP status code: 200 (data successfully processed), 400 (invalid parameters), 401 (authentication failed - token expired), 404 (worksheet/workbook not found), 409 (data range conflict), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. Empty for successful operations. For failures, contains actionable information such as: 'Worksheet not found', 'Access token expired', 'Rate limited', etc.
Create a Table
Create a new table in a specified worksheet using Microsoft Graph API. Requires workbook ID, sheet name, range address, and hasHeaders flag. Returns new table metadata, status code, and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook containing the sheet. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by Get Workbooks action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'
- SheetName: The name of the worksheet where the table will be created. Sheet names are case-sensitive. Example: 'Sheet1', 'Sales Data'. You can obtain sheet names from Get Sheets action.
- TableName: The name for the new table. Must be unique within the worksheet and cannot exceed 255 characters. Example: 'SalesTable', 'EmployeeData'
- HasHeaders: Whether the first row of the table contains headers (column names). Set to true if the first row contains headers; false if the first row contains data. Default is true.
Options:
- RangeAddress: The Excel range address containing the table data (optional). Supports formats like 'A1:D10' (rectangular range), 'A:D' (entire columns), '1:10' (entire rows). If left empty, the table will be created from the worksheet's entire used range (all data currently in the sheet).
Output:
- NewTable (object): Object containing details of the newly created table: id (unique table identifier), name (table name), address (range address, e.g., 'Sheet1!A1:D5'), column headers (if hasHeaders=true), and other table metadata. Empty object if creation failed.
- StatusCode (number): HTTP status code: 201 (table created successfully), 400 (invalid range address or parameters), 401 (authentication failed - token expired), 404 (worksheet/workbook not found), 409 (table name already exists), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. Empty for successful operations. For failures, contains actionable information such as: 'Invalid range format', 'Worksheet not found', 'Table name already exists', 'Access token expired', etc.
Delete a Table
Delete a specified table from an Excel workbook using Microsoft Graph API. Requires workbook ID, sheet name, and table name parameters. Returns success status, status code, and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook containing the table. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by Get Workbooks action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'
- SheetName: The name of the worksheet containing the table. Sheet names are case-sensitive. Example: 'Sheet1', 'Sales Data'. You can obtain sheet names from Get Sheets action. ⚠️ WARNING: This action will permanently delete the entire table structure (all rows, columns, formulas).
- TableName: The name or ID of the table to delete. Table names are unique within a worksheet and can be obtained from Create a Table action output or Excel table list. Example: 'SalesTable', 'EmployeeData'. 🚨 This will permanently delete the entire table - all data will be lost.
Output:
- Success (bool): Boolean flag indicating whether the table was successfully deleted. True = entire table including structure and all data permanently deleted and cannot be recovered; False = operation failed (check ErrorMessage and StatusCode for details).
- StatusCode (number): HTTP status code: 204 (table deleted successfully - No Content), 400 (invalid parameters), 401 (authentication failed - token expired), 404 (table/worksheet not found), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. Empty for successful operations. For failures, contains actionable information such as: 'Table not found', 'Access token expired', 'Authentication failed', etc. CRITICAL: Deletion is permanent and cannot be undone.
Convert to Range
Convert a table to a normal cell range in an Excel workbook using Microsoft Graph API. Requires workbook ID, sheet name, and table name parameters. Returns success status, status code, and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook containing the table. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by Get Workbooks action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'
- SheetName: The name of the worksheet containing the table. Sheet names are case-sensitive. Example: 'Sheet1', 'Sales Data'. You can obtain sheet names from Get Sheets action. ⚠️ WARNING: This operation converts the table to a range - table functionality (filters, sorting, structured references) will be lost.
- TableName: The name or ID of the table to convert to a range. Table names are unique within a worksheet and can be obtained from Create a Table action output or Excel table list. Example: 'SalesTable', 'EmployeeData'. After conversion, the data will be converted to a regular cell range without table features.
Output:
- Success (bool): Boolean flag indicating whether the table was successfully converted to a range. True = table converted to regular range, table features removed but data preserved; False = operation failed (check ErrorMessage and StatusCode for details).
- StatusCode (number): HTTP status code: 200 (table converted to range successfully), 400 (invalid parameters - may already be a range), 401 (authentication failed - token expired), 404 (table/worksheet not found), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. Empty for successful operations. For failures, contains actionable information such as: 'Table not found', 'Already a range', 'Access token expired', etc.
Get Rows
Retrieve row data from a specified table in an Excel workbook using Microsoft Graph API. Requires workbook ID, sheet name, and table name parameters. Returns row data array, status code, and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook containing the table. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by Get Workbooks action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'
- SheetName: The name of the worksheet containing the table. Sheet names are case-sensitive. Example: 'Sheet1', 'Sales Data'. You can obtain sheet names from Get Sheets action.
- TableName: The name or ID of the table to retrieve rows from. Table names are unique within a worksheet and can be obtained from Create a Table action output or Excel table list. Example: 'SalesTable', 'EmployeeData'. Note: This retrieves all data rows in the table, excluding the header row.
Options:
- Limit: Maximum number of rows to return (optional). Used for pagination. Default is empty (returns all rows). Combine with Offset for efficient data retrieval. Example: Limit=10 means return at most 10 rows.
- Offset: Number of rows to skip from the beginning (optional, default 0). Used for pagination. Combine with Limit for efficient data retrieval. Example: Offset=10, Limit=20 returns rows 11-30.
Output:
- Rows (object-array): Array of row objects retrieved from the table with pagination support. Each row contains 'index' (row position starting at 0) and 'values' (array of cell values). Pagination applied based on Limit and Offset parameters. Example: [{"index": 0, "values": ["John", "Doe", 30]}, {"index": 1, "values": ["Jane", "Smith", 28]}]
- StatusCode (number): HTTP status code: 200 (rows retrieved successfully), 400 (invalid parameters or Limit/Offset validation failed), 401 (authentication failed), 404 (table/worksheet not found), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message. Empty for successful operations. May include information about pagination parameter validation, table not found, access denied, etc.
Append Rows to Table
Append rows to a specified table in an Excel workbook using Microsoft Graph API. Requires workbook ID, sheet name, table name, and row data parameters. Supports JSON or CSV format data. Returns success status, status code, and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook containing the table. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by Get Workbooks action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'
- SheetName: The name of the worksheet containing the table. Sheet names are case-sensitive. Example: 'Sheet1', 'Sales Data'. You can obtain sheet names from Get Sheets action.
- TableName: The name or ID of the table to append rows to. Table names are unique within a worksheet and can be obtained from Create a Table action output or Get Sheets action. Example: 'SalesTable', 'EmployeeData'
- Data: The row data to append, supporting two formats: 1) JSON Array: [["value1","value2","value3"], ["value4","value5","value6"]] (each inner array is one row); 2) Comma-Separated Text: 'value1,value2,value3
value4,value5,value6' (rows separated by newlines, columns by commas). Column count must match table structure. Example: [[1,"Apple",8.88],[2,"Orange",5.99]] or '1,Apple,8.88
2,Orange,5.99'
Output:
- Success (bool): Boolean flag indicating whether rows were successfully appended to the table. True = all rows added without errors; False = operation failed (check ErrorMessage and StatusCode for details). Note: Even if some rows fail, the operation may return partial success depending on API behavior.
- StatusCode (number): HTTP status code: 200/201 (rows appended successfully), 400 (invalid data format or column count mismatch), 401 (authentication failed - token expired), 404 (table/worksheet not found), 409 (data conflict or constraint violation), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. Empty for successful operations. For failures, contains actionable information such as: 'Column count mismatch', 'Table not found', 'Access token expired', 'Invalid JSON format', etc.
Get Columns
Retrieve column data from a specified table in an Excel workbook using Microsoft Graph API. Requires workbook ID, sheet name, and table name parameters. Returns column data array, status code, and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook containing the table. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by Get Workbooks action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'
- SheetName: The name of the worksheet containing the table. Sheet names are case-sensitive. Example: 'Sheet1', 'Sales Data'. You can obtain sheet names from Get Sheets action.
- TableName: The name or ID of the table to retrieve column information from. Table names are unique within a worksheet and can be obtained from Create a Table action output or Excel table list. Example: 'SalesTable', 'EmployeeData'. Returns all columns defined in the table structure.
Options:
- Limit: Maximum number of columns to return (optional). Used for pagination. Default is empty (returns all columns). Useful when table has many columns and you only need a subset. Example: Limit=5 means return at most 5 columns.
- Offset: Number of columns to skip from the beginning (optional, default 0). Used for pagination. Combine with Limit for efficient column retrieval. Example: Offset=3, Limit=5 returns columns 4-8.
Output:
- Columns (object-array): Array of column objects retrieved from the table with pagination support. Each column contains 'id' (unique identifier), 'name' (header name), 'index' (position), and 'calculatedColumnFormula' (for computed columns). Pagination applied based on Limit and Offset parameters. Example: [{"id": "col1", "name": "Product", "index": 0}, {"id": "col2", "name": "Price", "index": 1}]
- StatusCode (number): HTTP status code: 200 (columns retrieved successfully), 400 (invalid parameters or Limit/Offset validation failed), 401 (authentication failed), 404 (table/worksheet not found), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message. Empty for successful operations. May include pagination parameter validation errors, table not found, access denied, etc.
Lookup a Column
Lookup detailed information about a specific column in an Excel table using Microsoft Graph API. Requires workbook ID, sheet name, table name, and column name parameters. Returns column data object with id, name, index and values, status code, and error message.
Input Parameters:
- WorkbookId: The unique drive item ID of the Excel workbook containing the table. This ID can be obtained from: 1) The 'Workbook' output of Create a Workbook action (id field); 2) The file details returned by Get Workbooks action when searching for Excel files; 3) The file URL parameter in OneDrive/SharePoint. Example: 'b!-RhYrHaQ40OxF3bJ5eK1L2m3N4o5P6'
- SheetName: The name of the worksheet containing the table. Sheet names are case-sensitive. Example: 'Sheet1', 'Sales Data'. You can obtain sheet names from Get Sheets action.
- TableName: The name or ID of the table containing the column. Table names are unique within a worksheet and can be obtained from Create a Table action output or Excel table list. Example: 'SalesTable', 'EmployeeData'
- ColumnName: The name or ID of the specific column to retrieve. Column names are case-sensitive and can be obtained from Get Columns action. Example: 'ProductName', 'Price', 'Quantity'. Alternatively, you can use the column ID.
Options:
- IncludeValues: Whether to include column data values in the response (optional, default true). Set to false to retrieve ONLY column metadata (id, name, index) without data - useful for large columns to reduce response size and improve performance. Set to true to get complete column information including all cell values.
Output:
- Column (object): Object containing detailed information about the looked-up column: 'id' (unique column identifier), 'name' (column header name), 'index' (zero-based column position), and other column metadata. When IncludeValues=true, also includes 'values' array with all cell data. When IncludeValues=false, values field is removed. Empty object if column not found.
- StatusCode (number): HTTP status code: 200 (column found and retrieved successfully), 400 (invalid parameters - column name/ID may be malformed), 401 (authentication failed - token expired), 404 (column/table/worksheet not found), 429 (rate limited), 504 (timeout), 500/503 (server error)
- ErrorMessage (string): Detailed error message from Microsoft Graph API. Empty for successful operations. For failures, contains actionable information such as: 'Column not found', 'Table not found', 'Access token expired', 'Column name is incorrect', etc.
5. Example Usage
This section will guide you through creating a simple workflow to create a new Excel workbook in your OneDrive.
The workflow will consist of three nodes: Start -> Create a Workbook -> Answer.
1. Add the Tool Node
- In the workflow canvas, click the "+" button to add a new node.
- In the panel that appears, select the "Tools" tab.
- Find and select "Microsoft Excel" from the list of tools.
- In the list of supported operations for Microsoft Excel, click on "Create a Workbook" to add the node to your canvas.
2. Configure the Node
- Click on the newly added "Create a Workbook" node to open its configuration panel on the right.
- Credentials Configuration: At the top of the panel, find the credentials field. Click the dropdown menu and select your pre-configured Microsoft Excel credential.
- Parameter Configuration: Fill in the required input parameters for the action.
- FileName: Enter a name for your new workbook, for example, Monthly_Report.xlsx.
3. Run and Validate
- Once all required parameters are correctly filled, any error indicators on the workflow canvas will disappear.
- Click the "Run" button in the top-right corner of the canvas to execute the workflow.
- After a successful execution, you can click the log icon in the top-right corner to view the detailed input and output of the node, confirming that the operation was successful.
After completing these steps, your workflow is fully configured. When you run it, a new Excel workbook named "Monthly_Report.xlsx" will be created in the root directory of your OneDrive.
6. FAQs
Q: Why am I getting a 401 Unauthorized or 403 Forbidden error?
A: This typically indicates an issue with your credentials or permissions. Please check the following:
- Correct Credentials: Ensure you have selected the correct Microsoft Excel credential in the node configuration.
- API Permissions: Verify that the permissions granted when you configured your credentials in GoInsight are sufficient. You may need permissions like Files.ReadWrite.All or Sites.ReadWrite.All depending on where the files are stored.
- Token Expiration: Your access token may have expired. Try re-authorizing your credential in the GoInsight credentials section.
Q: What is a WorkbookId and how do I find it?
A: The WorkbookId is the unique identifier for an Excel file stored in OneDrive or SharePoint, also known as the drive item ID. The easiest way to find it within a workflow is to use the Get Workbooks operation. This action will return a list of all your Excel files, each with its corresponding id (which is the WorkbookId), name, and webUrl. You can then pass this ID to other nodes.
Q: What format should the Data parameter be in for appending rows?
A: The Data parameter is flexible and accepts a string in one of two formats:
- JSON Array of Arrays: A JSON-formatted string where each inner array represents a row. Example: [[1, "Product A", 10.50], [2, "Product B", 22.00]]
- CSV Format: A string where values are separated by commas and rows are separated by newline characters (\n). Example: "1,Product A,10.50\n2,Product B,22.00"
7. Official Documentation
For more in-depth information about the underlying API used by this node, please refer to the official Microsoft Graph API documentation for Excel:
Leave a Reply.