简体   繁体   English

Function 在谷歌应用脚本中下一次执行开始之前没有完全运行

[英]Function not running fully before next execution starts in google apps script

I have 3 functions I want to run one after the other.我有 3 个功能要一个接一个地运行。 For some reason, my first function doesn't fully run when my code is as follows:由于某种原因,当我的代码如下时,我的第一个 function 没有完全运行:

function main_url_generator_(){
  
  
  create_owner_links_list();
  delete_all_filter_views();
  create_filter_view_w_url();

};

When I separate them into 2 functions it works fine:当我将它们分成 2 个函数时,它工作正常:

function main_url_generator_1(){
 
  create_owner_links_list();

};



function main_url_generator_2(){
  
  delete_all_filter_views();
  create_filter_view_w_url();


};

How can I combine all 3 functions and ensure the first function( create_owner_links_list() ) has fully run before it goes through the rest of the functions.如何组合所有 3 个函数并确保第一个函数( create_owner_links_list() )在通过函数的 rest 之前已完全运行。 Please help请帮忙

With the help of comments(Thanks all), I modified my function as follows and it works great:在评论的帮助下(谢谢大家),我修改了我的 function 如下,效果很好:

function main_url_generator(){
  
  
  create_owner_links_list();
  //Added the SpreadsheetApp.flush function
  SpreadsheetApp.flush(); 
  delete_all_filter_views();
  create_filter_view_w_url();

};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何确保在 google 应用程序脚本中执行下一行之前完成 google.script.run 函数 - how to ensure a google.script.run function is done before executing next lines in google apps scripts 检查功能是否正在与Google Apps脚本和Google Web Apps一起运行 - Check if function is running with Google Apps Script and Google Web Apps 如何在此Google Apps脚本中更改执行流程和函数调用? - How to change the flow of execution and function call in this Google Apps Script? Google Apps脚本的执行超时 - Execution Timeout for Google Apps Script 谷歌脚本应用程序在第一个中运行下一个功能 - google script apps run the next function within the first one 如何在运行脚本之前提交在活动单元格中所做的更改? (谷歌表格/谷歌应用脚本) - How to commit changes made in active cell before running script? (Google Sheets / Google Apps Script) 如何修复以随机顺序运行的 Google Apps 脚本功能 - How to fix Google Apps Script Function Running in random sequence Google Apps脚本执行API:脚本错误消息:找不到脚本功能:【JavaScript】 - Google Apps Script Execution API: Script error message: Script function not found:【JavaScript】 在运行下一个之前等待上一个执行? - Wait for previous execution before running next one? 在 Function 开始运行前设置定时器 - Set timer before Function starts running
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM