是否需要打开Goog​​le工作表才能运行功能? [英] Does google sheet needs to be opened for a function to run?

查看:68
本文介绍了是否需要打开Goog​​le工作表才能运行功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Google工作表,其中的单元格中有一些功能,例如:

I have a google sheet where there are some functions in the cell like:

    =CLEAN(SUBSTITUTE(CONCATENATE("https:",scrape(A1)),"https:",))
 =CLEAN(SUBSTITUTE(CONCATENATE("https:",scrape(B1)),"https:",))

在幕后,我运行了脚本函数,该脚本函数提取单元格的输出(在scrape函数运行之后),并通过API将值推入第3方数据库.

and behind the scenes I have script function running that pulls the output of the cells (after scrape function runs) and pushes the value to a 3rd party database via API.

我通过这种方法定期运行脚本功能:

I have the script functions running periodically by this approach:

ScriptApp.newTrigger('API_Data_push_function')
.timeBased()
.everyHours(24)
.create();

但是我注意到在第三方数据库中,值即将出现

but I have noticed in the 3rd party database that values are coming like

#NAME?

但是当我打开Goog​​le工作表并手动运行脚本功能时,它运行正常.

But when I open the google sheet and run the script function manually, it runs fine.

所以,我试图了解是否需要打开Goog​​le表格用户界面才能使单元格功能正常运行?或者,如果问题在于API数据推送功能的运行速度快于返回 #NAME?值的单元格功能.

So, I am trying to understand if google sheet UI needs to be opened for cell functions to run properly? OR if the issue is the API data push function is running faster than cell function which is returning #NAME? value.

任何人都可以确认是否需要打开Goog​​le工作表才能使单元格功能正常工作吗?如果是,是否有任何方法可以让脚本强制先执行单元功能,然后再开始运行脚本?

Can anyone confirm if google sheet needs to be opened for cell functions to work? if yes, any way for script to force cell function to run first prior to script to start running?

推荐答案

否...但是您可能需要使用

No...But you might need to use SpreadsheetApp.flush() in your scripts to make sure that when you read values off of the spreadsheet after intermediate operations that your getting the correct values.

这篇关于是否需要打开Goog​​le工作表才能运行功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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