如何从Google表格获取超链接
我可以使用以下内容(只是代码的一部分)成功地从Google表格中获取数据作为JSON源:
I can successfully fetch the data from a Google sheet as a JSON source, with something like the following (just a part of the code):
> var Sheet = 'https://spreadsheets.google.com/feeds/list/SheetKey/od6/public/values?alt=json';
>
> function callback(data){
> var cells = data.feed.entry;
> .
> .
> .
因此,当我以这种方式获取条目时,我无法找到一种方法来获取在Google表格中添加的超链接" URL,我知道我可以将其写为新列并以这种方式进行获取,但是我正在寻找一种读取添加到单元格本身的超链接的方法,请参见以下屏幕截图,其中显示了我所指的内容:
So when I get the entries this way, I cannot find a way to fetch the "Hyperlink" URL that was added in the Google Sheet, I know I can write it as a new column and fetch it that way, but I am looking for a way to read the Hyperlink that is added to the cell itself, please see the following screenshot, it shows what I am referring to:
所以我可以获取某些文本",但不能获取超链接" http://www.hyperlink.com ",有人可以帮忙吗?
So I can fetch "some text", but not the hyperlink "http://www.hyperlink.com", anybody can help?
您需要在请求中设置valueRenderOption
参数.有关此问题的更多详细信息,请参见: https://developers.google.com /sheets/api/reference/rest/v4/ValueRenderOption .
You need to set the valueRenderOption
parameter in your request. More details about this are here: https://developers.google.com/sheets/api/reference/rest/v4/ValueRenderOption.
要获取HYPERLINK,需要将值设置为FORMULA
.
To get the HYPERLINK, you need to set the value as FORMULA
.
有关电子表格API的更多详细信息,请参见: https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/get .
More details about the spreadsheets API is here: https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/get.