gspread
gspread copied to clipboard
Error raised when using insert_row function
Hi, I received this error after running insert_row function:
APIError: {
"error": {
"code": 400,
"message": "Invalid value at 'data.values[0]' (type.googleapis.com/google.protobuf.ListValue), \"A\"",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "data.values[0]",
"description": "Invalid value at 'data.values[0]' (type.googleapis.com/google.protobuf.ListValue), \"A\""
}
]
}
]
}
}
Although the function inserts a new row according to the index, this error was raised.
The parameters along with the function in my code: sheet.insert_row('A', index=18)
the answer to fix this would have been
sheet.insert_row(['A'], index=18)
in case you google your way into this.
(it was the square brackets around the 'A')