如何使用Google Sheets Api V4格式化格式检索工作表数据 [英] How to retrieve sheet data with formatting with Google Sheets Api V4

查看:59
本文介绍了如何使用Google Sheets Api V4格式化格式检索工作表数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想从具有格式的电子表格中检索工作表数据.

I want to retrieve only sheet's data from a spreadsheet with formatting.

如何通过Sheets Api实现相同的功能?

How to achieve the same with Sheets Api?

推荐答案

不清楚您要获取哪种数据.您要检索在Google表格用户界面中格式化的值吗?如果是这样,请使用 spreadsheets.values.获取 API.参数 valueRenderOption 控制方式值被格式化.默认情况下,该值为 FORMATTED_VALUE ,它将返回在Sheets UI中格式化的数据.其他值在 ValueRenderOption 参考页上列出.有关更多信息,请参见基础阅读示例.

It isn't clear from your question just what kind of data you want to get. Do you want to retrieve the values as they're formatted in the Google Sheets UI? If so, then use the spreadsheets.values.get API. The parameter valueRenderOption controls how the values are formatted. By default, the value is FORMATTED_VALUE, which will return the data as it's formatted in the Sheets UI. Other values are listed on the ValueRenderOption reference page. See the Basic Reading sample for more information.

如果您要检索有关格式本身的信息,请使用 CellData (位于 sheets.data.rowData.values ),在 userEnteredFormat effectiveFormat 字段中.

If you want to retrieve the information about the format itself, use the spreadsheets.get API. Format information is in the response's CellData (at sheets.data.rowData.values), in both the userEnteredFormat and effectiveFormat fields.

这篇关于如何使用Google Sheets Api V4格式化格式检索工作表数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆