The behaviour of Google Sheets App Script Range.setValues
function seems to be tied to the number format of the cell to be modified:
- If you set Format->Number->Automatic, it will try to parse numeric strings as numbers.
- If you set Format->Number->Plain text, it will coerce boolean
false
to string"false"
.
What I'd much enjoy is a sensible behaviour similar to Google Sheets API v4, where you can force it to interpret values as raw.
What I am looking for is unambiguous behaviour, where javascript
- string
""
stays string. - number
1.23
stays number. - boolean
true
stays boolean. - Date
Date(...)
stays date.
Does anyone know whether something like that is possible?