gspread icon indicating copy to clipboard operation
gspread copied to clipboard

Error raised when using insert_row function

Open TryingOutSomething opened this issue 7 years ago • 1 comments

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)

TryingOutSomething avatar Mar 11 '19 16:03 TryingOutSomething

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')

Paul-PADataAnalytics avatar Sep 29 '19 20:09 Paul-PADataAnalytics