Using a script to generate docs from rows in Googl

2019-08-22 04:21发布

问题:

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.

回答1:

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
  }