Google Sheets API v4和valueInputOption [英] Google Sheets API v4 and valueInputOption
问题描述
我的电子表格中有三列。第一个是日期,第二个和第三个是简单的字符串。
当我批量上传我的数据 valueInputOption =RAW
我的日期列出现错误结果。所有的日期在他们面前都有一个无形的撇号。
当我使用 valueInputOption =USER_ENTERED
时,所有的日期都很好,但其他值是不会将其解释为实际值,而应视为Google解析的值。例如,字符串2-3-4将表示为02/04/2004或类似的东西。
我想将数据列表示为 USER_ENTERED
,并将字符串列表示为 RAW
。
有没有办法为单元格(列)设置 valueInputOption
?我已经找到了答案。
为了让所有的人都知道数据以字符串表示,您应该:
它适用于所有电子表格列具有自动类型设置。不知道其他格式类型的colums将会发生什么。
I have three columns in my spreadsheet. The first one is date, the second and the third are simple strings.
When I do batch upload of my data valueInputOption = "RAW"
I get a wrong result for my Date column. All dates have an invisible apostrophe before them. String columns are OK.
When I use valueInputOption = "USER_ENTERED"
all dates are good, but other values are interpreted not as actual values but as Google parsed values. For example a string "2-3-4" will be represented as 02/04/2004 or something like that.
I want data column to be represented as USER_ENTERED
and string columns as RAW
.
Is there any way to set valueInputOption
for a cell (column)?
I have found the answer.
In order to make all needeed data to be represented as string, you should:
- set valueInputOption = USER_ENTERED;
- prepend it with apostrophe sign just like this one '.
In this case other columns type will be determined automatically based on Google's own algorithms and columns with cells prepended with ' sign will be shown exactly as you enteren them
It works when all spreadsheet columns have Automatic type set. Not sure what will happen for colums with other format types.
这篇关于Google Sheets API v4和valueInputOption的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!