google form submit script -


on form submit trying value of record number cell set in spreadsheet. getting incorrect values in confirmation message though logger displays right value.

        /**         * gets list of responses , display recordnumber spreadsheet         *         */            function ticketnumberalert() {                var form = formapp.getactiveform();                 logger.log("form name " + form.getid() + " " + form.gettitle());                logger.log("form destination " + form.getdestinationid() + form.getdestinationtype());                 var sheet = spreadsheetapp.openbyid(form.getdestinationid());                 var lastrow = sheet.getlastrow();                 logger.log("record number " + lastrow);                 var lastitem = sheet.getrange('i'+lastrow).getvalue();                 var newrecnum = lastitem + 1;                 logger.log("last record number" + newrecnum);                 //form.setconfirmationmessage('thanks registering. ticket number ' + lastitem );                 form.setcustomclosedformmessage('thanks registering. ticket number ' + newrecnum );      } 

the confirmation message display #15. logs display correct incremented recordnumber value.

[14-06-01 07:06:41:430 edt] form name 1gixwfeqiyhskxzqbjjha2ctdho8mafwqpcbjiiehac8
[14-06-01 07:06:41:529 edt] form destination 0agz_q0okrzbjdg9cbzdkqtjxytdwoxdrbwpyewfuvlespreadsheet [14-06-01 07:06:42:008 edt] record number 18 [14-06-01 07:06:42:045 edt] last record number19

i should have used setconfirmationmessage instead of setcustomclosedformmessage. customclosed form message message displayed when form not accepting more responses.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -