刷新按钮/自动更新 GOOGLE 电子表格 [英] Refresh Button / Auto Update GOOGLE SPREADSHEET

查看:42
本文介绍了刷新按钮/自动更新 GOOGLE 电子表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望你能帮助我.一段时间以来,我一直在努力让它发挥作用.

I hope you can help me. I have been trying to get this working for quite some time.

我从网站上获取 API,通过 importjson() 将其导入谷歌电子表格

I am taking the API from a website import it into google spreadsheets VIA importjson()

ImportJSON("http://api.796.com/v3/futures/ticker.html?type=weekly")

ImportJSON("http://api.796.com/v3/futures/ticker.html?type=weekly")

https://gist.github.com/chrislkeller/5719258

我将 json 数据导入 google 电子表格没有问题,现在最难的部分是更新数据,我真的希望它自动更新,但即使是立即更新"按钮也会很棒.

I have no problem importing the json data into google spreadsheet, now the hard part is making the data update, I would really like it to auto update but even a "update now" button would be great.

谢谢,这让我发疯.BV

Thanks, This has been driving me nuts. BV

推荐答案

所以我也在寻找一种很好的方法来做到这一点.这是我目前发现的.

So I was searching for a good way to do this as well. Here is what I have found so far.

如果你像这样改变importJSON的函数行:

If you change the function line of the importJSON like this:

function ImportJSON(url, query, parseOptions, recalc) {
}

这只是将 recalc 参数添加到函数定义中.这是一个技巧",因为该参数除了让 GSheet 认为某些事情发生了变化外,不用于任何其他用途.然后在对 ImportJSON(在 GSheet 单元格中)的调用中,添加如下函数调用:

Which just adds the recalc parameter to the function definition. This is a 'trick' because that parameter is not used for anything other than to make GSheet think something has changed. Then in the call to ImportJSON (in a GSheet cell), you add in the function call like this:

=ImportJSON("https://yourDomain.com/something","","rawHeaders",A1)

然后在工作表中,您可以手动将 A1 的值更改为与实际不同的任何值.工作表和所有导入都将刷新.

Then in the sheet you can manually change the value of A1 to anything different than it is. The Sheet and all the imports will get refreshed.

另一个......非技术性技巧......手动将A1更改为1,然后是2,然后是3.每次工作表都会重新计算.现在您可以使用 UNDO 和 REDO 按钮更改数字并重新计算工作表.

Another ... non-technical trick ... manually change A1 to 1 then 2 then 3. Each time the sheet will recalc. Now you can use the UNDO and REDO buttons to change the numbers and recalc the sheet.

有点杂乱无章的 Hack,但它确实可以实现一种一键式重新计算".

A little of a kludge Hack, but it does make for a one-button "recalc" of a sort.

这篇关于刷新按钮/自动更新 GOOGLE 电子表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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