I need to update (With blank info) with batch multiple merged cells with Python using Google Sheets API v4 (No gspread). I have this code:
blank = setValue("") <----- I set a variable with no data to delete all the info that the cell can contains
dataBlank = [
...
{
'range': 'AB83',
'values': blank
}
{
'range': 'BH75:BH82', # <------- I think here is the problem
'values': blank
} ...
]
body = {
'valueInputOption': value_input_option,
'data': dataBlank
}
result = service.spreadsheets().values().batchUpdate(spreadsheetId=registro_id, body=body).execute()
print('{0} celdas borradas - Registro'.format(result.get('totalUpdatedCells')))
def setValue(value):
rvalue = [value]
avalue = [rvalue]
return avalue
It runs, but in the sheet it only updates the first cell of the range, and the whole range does'n update.
I try with 'range' : 'BH75:BH82'
, 'range' : 'Sheet1!BH75:BH82'
and I can't update the whole range. I need to use the batch update because I need to check the performance and don't pass the quote limit from Google Cloud.
I het this:
Only the first cell is updated. If I update individual cells o merged cells without range it works fine, but if I use a range to update doesn't work.