如何从Google表格获取超链接 [英] How to fetch the Hyperlink from Google Sheets

查看:658
本文介绍了如何从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.

这篇关于如何从Google表格获取超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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