如果选中了复选框,则使用脚本从Google表格中的行生成文档 [英] Using a script to generate docs from rows in Google Sheet if checkbox is checked

查看:78
本文介绍了如果选中了复选框,则使用脚本从Google表格中的行生成文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试根据Google表格中的行生成Google文档/ PDF。我的目标是让用户按下UI菜单按钮,并且只有在该行的复选框中打勾时,它才会生成文档。



我有其余的代码正常工作,只是找到了为什么要让脚本检查复选框是否为票证并且仅在选中复选框的情况下才生成文档。 div>

在没有看到代码的情况下(您应该发布该代码),可以说您需要在开头添加一个IF语句,该语句将检查某个单元格是true还是false(这是checked和



也许这样的方法可能有效:

  if (sheet.getRange(您的范围/单元格/变量在这里).getValue()=='TRUE'{
您的代码在这里
}


I'm trying to generate Google Docs / PDFs from rows in a Google Sheet. My aim is for the user presses a UI menu button, and it will only generate the Docs if a checkbox is ticked for that row.

I've got the rest of the code working, its just finding the why to get the script to check if a checkbox is ticket and only generate the doc if it is checked.

解决方案

Without seeing the code (which you should post), I can say that you need to add an IF statement in the beggining, that will check if a certain cell is true or false (which is the state of checked and unchecked).

Perhaps something like this might work:

if(sheet.getRange(your range/cell/var here).getValue() == 'TRUE' {
    your code here
  } 

这篇关于如果选中了复选框,则使用脚本从Google表格中的行生成文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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