google-apps-script - 在 google docs 脚本中添加和/或 if 语句的子句

标签 google-apps-script google-sheets

我需要在 google 脚本中包含和/或声明 if 条件。我是脚本新手,无法找到这样做的方法。请帮忙

if (dateval<>"") and (repval<>"") {condition if true}

感谢您的帮助。

最佳答案

您可以在 that subject 上找到所有信息(和其他人)on this site.

在你的例子中,答案是

if (dateval!="" && repval!="") {do something}

关于google-apps-script - 在 google docs 脚本中添加和/或 if 语句的子句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15855762/

相关文章:

javascript - 在 html 中使用 googlescript api

javascript - 类型错误 : Cannot read property "values" from undefined.(第 9 行,文件 "Code")

google-apps-script - 编辑库中 Google 脚本的早期版本

javascript - getLastRow() 问题

google-apps-script - 在 Google 表格中将不相邻的列转换为正确的/标题大小写

javascript - 谷歌应用程序脚本不循环

javascript - 使用 Apps 脚本在 onclick 内调用函数

google-sheets - 如何使用带有 OFFSET 的 ARRAYFORMULA 到前一行而不会出现循环引用错误

android - google sheet 自定义菜单功能在 android 上的 google sheet 中不可见

google-apps-script - GAS/Google Sheets在insertRows、insertRowAfter、insertRowsAfter的应用中出错