Trying to update a cell in a Google Sheet with the source attached, I find the error "Invalid value at 'requests[0].update_cells' (oneof), oneof field 'area' is already set. Cannot set 'start'", and I don't know what I am doing wrong
[{
"updateCells"={
"fields"="totalUpdatedCells",
"range"={
"endColumnIndex"=179,
"endRowIndex"=7,
"sheetId"=XXXXX,
"startColumnIndex"=179,
"startRowIndex"=7
},
"rows"=[
{
"values"=[
{
"userEnteredValue"={
"stringValue"="My text"
}
}
]
}
],
"start"={
"columnIndex"=179,
"rowIndex"=7,
"sheetId"=XXXXX
}
}
}]
This is the concrete error:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid value at 'requests[0].update_cells' (oneof), oneof field 'area' is already set. Cannot set 'start'",
"reason" : "badRequest"
} ],
"message" : "Invalid value at 'requests[0].update_cells' (oneof), oneof field 'area' is already set. Cannot set 'start'",
"status" : "INVALID_ARGUMENT"
}
A hint from where can I throw?
EDIT for @Tanaike:
The body of request:
{
"requests"= [
{
"updateCells"= {
"fields"="userEnteredValue",
"rows"= [
{
"values"= [
{
"userEnteredValue"= {
"stringValue"="My text"
}
}
]
}
],
"start"= {
"columnIndex"=179,
"rowIndex"=7,
"sheetId"=XXXXX
}
}
}
]
}
and the error of request:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid requests[0].updateCells: GridCoordinate.columnIndex[179] is after last column in grid[25]",
"reason" : "badRequest"
} ],
"message" : "Invalid requests[0].updateCells: GridCoordinate.columnIndex[179] is after last column in grid[25]",
"status" : "INVALID_ARGUMENT"
}
rangeand modifying the fields touserEnteredValue? If that modification didn't work, please provide the whole request body for replicating your situation. - Tanaike"columnIndex"=179and"rowIndex"=7are used. This means the cellFX8. So I'm thinking that you want to put the text to the cellFX8. From your error message, it is found that the column length of your sheet is less than 180 columns. So your consideration ofI think the range field should be includedis not correct. If you want to put the text to the cellFX8, please add the columns. - Tanaike