I am working on a Python script that updates the next row on a Google Sheet using spreadsheets.values.batchUpdate. All of the values in my request body are posting correctly except for the last value in my array, which I want to be a note in the cell. I found this article which did not seem to solve my problem. Link If anyone has any additional insight on how to add a note to a spreadsheets.values.batchUpdate that would be very helpful. I want the note to post to the '' in the first values array.
My function that posts the values is:
sheet = service.spreadsheets()
result = sheet.values().get(spreadsheetId=spreadsheetId, range='Sheet1!A1:A').execute()
values = result.get('values', [])
new_row = str(len(values)+1)
data_range = 'A{0}:J{0}'.format(new_row)
assignment_range = 'Q{0}'.format(new_row)
range_body_values = {
'value_input_option': 'USER_ENTERED',
'data': [
{
'majorDimension': 'ROWS',
'range': data_range,
'values': [
[form_values['date'], form_values['name'], form_values['email'], form_values['manufacturer'],
form_values['generation'], form_values['bore_diameter'], form_values['thickness'],
form_values['power_added'], '']
]
},
{
'majorDimension': 'ROWS',
'range': assignment_range,
'values': [
['Unassigned']
]
}
]}
request = service.spreadsheets().values().batchUpdate(spreadsheetId=spreadsheetId, body=range_body_values)
response = request.ex```