gspread - How do I enter row values using valueInputOption?

Viewed 25

I want to have a list of changes that I can append to textRequests. Im not sure what is wrong with my syntax. I keep getting the following error:

gspread.exceptions.APIError: {'code': 400, 'message': 'Invalid JSON payload received. Unknown name "": Root element must be a message.', 'status': 'INVALID_ARGUMENT', 'details': [{'@type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'description': 'Invalid JSON payload received. Unknown name "": Root element must be a message.'}]}]}

Heres what I've tried:

textRequests.append({
  "valueInputOption": "USER_ENTERED",
  "data": [
    {
      "range": "A1",
  "majorDimension": "COLUMNS",
  "values": [["donkey"]]
    }
  ]
})
sheet.batch_update(textRequests)

I'm not exactly sure if I am writing the request properly. Can someone tell me what I am doing wrong?

0 Answers
Related