-
Notifications
You must be signed in to change notification settings - Fork 682
Open
Description
Description
When using +append --json-values with a multi-row JSON array, all values are appended as a single row instead of separate rows.
Steps to Reproduce
# Append 2 rows via --json-values
gws sheets +append --spreadsheet <ID> --json-values '[["Alice","100"],["Bob","200"]]'Expected: 2 rows appended
| A | B |
|---|---|
| Alice | 100 |
| Bob | 200 |
Actual: 1 row appended with all values concatenated across columns
| A | B | C | D |
|---|---|---|---|
| Alice | 100 | Bob | 200 |
Possible Cause
This may be related to parse_append_args in src/helpers/sheets.rs — the --json-values branch parses the input as Vec<Vec<String>> but then calls .flatten().collect(), collapsing it into a single flat Vec<String>. Is this intentional, perhaps to support a specific use case? If not, it looks like AppendConfig.values would need to become Vec<Vec<String>> to preserve the row structure through to build_append_request.
Workaround
Using the raw API works correctly for multi-row appends:
gws sheets spreadsheets values append \
--params '{"spreadsheetId": "<ID>", "range": "Sheet1!A1", "valueInputOption": "USER_ENTERED"}' \
--json '{"values": [["Alice","100"],["Bob","200"]]}'Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels