How to do addition/subtraction in Google Sheet 'Update Value' query?

  • Goal: I am trying to add/subtract while using Google Sheet 'update spreadsheet' query. e.g. adding +1 to a variable each time the query is run { "count" : "count"+1}

  • Steps: I tried adding all kind of operator to the 'Update Value' and it turned it to a string, which won't work.

  • Details: sheetUpdate must be an object, for example: {"column": "value"}

  • Screenshots: Screenshot 2024-05-13 at 18.39.50

1 Like

hi @Hans_Calvin i haven't used google sheets with retool before, but have done a lot of Apps Scripts though...

maybe you can calculate the value you want in a Transformer, then reference its value in the object for updating sheet value?

// Transformer gets updated count
return {{myComponent1.value}} + 1
// Sheets updates with new value
  "gmv": {{myTransformer1.value}}