Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 如何运行只在Google Apps脚本中的值不为空时才执行某些操作的函数?_Google Apps Script_Google Sheets - Fatal编程技术网

Google apps script 如何运行只在Google Apps脚本中的值不为空时才执行某些操作的函数?

Google apps script 如何运行只在Google Apps脚本中的值不为空时才执行某些操作的函数?,google-apps-script,google-sheets,Google Apps Script,Google Sheets,如果分析员的名字不为空,如何编写一个只推送事件的函数 var analyst = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet Details").getRange(7,3).getValue(); GoogleAppsAPI有一个内置函数来检查单元格是否为空。检查它是否为空,如果为空,则设置值 iSheet.getRange(lowerBound+1,2,dumpL,21).setValues(whole) if(

如果分析员的名字不为空,如何编写一个只推送事件的函数

 var analyst = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet Details").getRange(7,3).getValue();

GoogleAppsAPI有一个内置函数来检查单元格是否为空。检查它是否为空,如果为空,则设置值

iSheet.getRange(lowerBound+1,2,dumpL,21).setValues(whole)

if(!iscellbank)
中的感叹号与它的含义相反,因此如果单元格不是空的,它将执行括号中的代码。

我尝试过这个方法,但它仍然会获取所有事件,即使单元格是空的empty@Nero范围是否完全为空(无空格、字符等)?如果是这样,.
isBlank()
应该返回true,从而导致
!iscellbank
为false。如果
isBlank()。尝试在调试模式下运行脚本,并在
if
语句上放置断点,以在运行时查看其值。
var isCellBlank = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet Details").getRange(7,3).isBlank();

if(!isCellBlank) {
    iSheet.getRange(lowerBound+1,2,dumpL,21).setValues(whole);
}