Edit a cell Google Sheet API

0

Again I come with a problem with the Google Sheet API:

For this case, I have a spreadsheet or Spreadsheet and I want to modify / edit one of its cells. The request would look like this:

{updateCells={
    fields=*, 
    range={
        endColumnIndex=6, 
        endRowIndex=2, 
        sheetId=123456789, 
        startColumnIndex=5, 
        startRowIndex=1
    }, 
    rows=[{
        values=[{
            userEnteredValue={
                stringValue==D2*(1-Ficha!L6)+Ficha!L2*Ficha!L6
            }
        }]
    }], 
    start={
        columnIndex=5, 
        rowIndex=1, 
        sheetId=123456789
    }
}}

If I launch it, Google gives me the following error:

{
  "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"
}

I sense that the request is malformed, but I can not find the error

If someone could give me a hand ...

Thanks in advance

Greetings

PS: I'm doing it with Java, but seeing that the Google API encapsulates the requests I have chosen not to put it

    
asked by Miguel García 04.09.2018 в 20:25
source

1 answer

0

One of the problems, perhaps among others, that your request has is that the properties are not enclosed in quotes and you are not placing quotes in quotes either. For example

stringValue==D2*(1-Ficha!L6)+Ficha!L2*Ficha!L6

should be

"stringValue"="=D2*(1-Ficha!L6)+Ficha!L2*Ficha!L6"

Review the example in link

    
answered by 06.09.2018 в 20:13