Describe the bug
The Google Sheets Get All action always calls worksheet.get_all_records(). That requires a unique header row in gspread, so the action fails on worksheets with duplicate or blank headers even when the caller only needs raw rows.
Confirmed in current main at 2a6aa9d40e3ba5ba17787691018069d6a1498cd3:
|
try: |
|
sheet = GoogleSheetFactory(credentials_json).create_spreadsheet(sheet_id) |
|
if worksheet_name: |
|
worksheet = sheet.worksheet(worksheet_name) |
|
else: |
|
worksheet = sheet.sheet1 |
|
list_of_dicts = worksheet.get_all_records() |
|
siemplify.result.add_result_json(list_of_dicts) |
|
except Exception as err: |
|
status = EXECUTION_STATE_FAILED |
|
message = str(err) |
|
else: |
|
status = EXECUTION_STATE_COMPLETED |
|
message = "All rows were fetched successfully" |
|
siemplify.end(message, status is EXECUTION_STATE_COMPLETED, status) |
The action metadata exposes only Sheet Id and Worksheet Name; there is no raw row mode or expected_headers parameter:
|
parameters: |
|
- default_value: <Sheet-Id> |
|
description: 'The sheet id can be found in the sheet url. |
|
|
|
https://docs.google.com/spreadsheets/d/{YourSpreadSheetId}/edit#gid=0' |
|
is_mandatory: true |
|
name: Sheet Id |
|
type: string |
|
- default_value: <Sheet-Name> |
|
description: 'The worksheet name is the Sheet tab name. The default Sheet name |
|
is "Sheet1". Note: it is case sensitive. ' |
|
is_mandatory: false |
|
name: Worksheet Name |
|
type: string |
|
script_result_name: ScriptResult |
To Reproduce
Steps to reproduce the behavior:
- Use a worksheet that has duplicate or blank header cells.
- Run
Google Sheets - Get All.
- Set
Sheet Id and Worksheet Name.
- Observe that the action fails with a gspread header error.
Observed error:
the header row in the worksheet is not unique, try passing 'expected_headers' to get_all_records
Expected behavior
The action should provide a way to read raw rows without requiring unique headers, for example by using worksheet.get_all_values() in a raw mode, or it should expose an expected_headers option for get_all_records().
Additional context
The current behavior makes Get All unusable for tracking sheets that are not modeled as unique-header records.
Describe the bug
The Google Sheets
Get Allaction always callsworksheet.get_all_records(). That requires a unique header row in gspread, so the action fails on worksheets with duplicate or blank headers even when the caller only needs raw rows.Confirmed in current
mainat2a6aa9d40e3ba5ba17787691018069d6a1498cd3:content-hub/content/response_integrations/third_party/community/google_sheets/actions/GetAll.py
Lines 24 to 38 in 2a6aa9d
The action metadata exposes only
Sheet IdandWorksheet Name; there is no raw row mode orexpected_headersparameter:content-hub/content/response_integrations/third_party/community/google_sheets/actions/GetAll.yaml
Lines 10 to 24 in 2a6aa9d
To Reproduce
Steps to reproduce the behavior:
Google Sheets - Get All.Sheet IdandWorksheet Name.Observed error:
Expected behavior
The action should provide a way to read raw rows without requiring unique headers, for example by using
worksheet.get_all_values()in a raw mode, or it should expose anexpected_headersoption forget_all_records().Additional context
The current behavior makes
Get Allunusable for tracking sheets that are not modeled as unique-header records.