i trying write script creates table in google docs file results after user has submitted form.
in form user can enter 16 invoices , 16 payments; on summary pdf don't want display table full of empty cells if user has entered 1 invoice.
i tried write if statement "if "invoice number" cell not empty, create table row, if not, nothing", creates rows anyway when cells empty , can't quite figure out why.
anyone have ideas? here's code:
var invoicedata = [['invoice number', 'invoice amount', 'due date of invoice']]; table1 = copybody.appendtable(invoicedata); var tab1row1=table1.appendtablerow(); if (sheet3.getrange("a20").getvalue() ==! 0);{ tab1row1.appendtablecell(sheet3.getrange("a3").getvalue()); tab1row1.appendtablecell("£" + sheet3.getrange("b3").getvalue()); tab1row1.appendtablecell(sheet3.getrange("c3").getvalue()); and same code repeated rows row 16 (but changed numbers obviuosly).
the cell a20 (which 1 specified within if statement) cell containing formula =value(a3).
thank in advance.
the not operator, exclamation point, can't after equal signs.
function testafunction() { logger.log(1===1); //true logger.log(1!==99); //true logger.log(1==!99); //false }; also, remove semi-colon.
should be:
if (sheet3.getrange("a20").getvalue() !== 0) {
Comments
Post a Comment