Google Spreadsheet: Wrap all text onEdit -


i have google spreadsheet sheet called wrapped sheet responses collected google form. on every new added response (thus onedit function), want call wrap text option on cells. opened script editor , created onedit.gs following code:

function onedit(){   var activesheet = spreadsheetapp.getactivespreadsheet();   if(activesheet.getname() == "wrapped sheet") {     var datarange = activesheet.getrange(1,1,data.length,headers.length);     datarange.setwrap(true);   } } 

however, function not triggered on new response. additionally, calling manually within script editor not report error.

you should go , give google script event docs full read.

you'll find out there specific event use case: on form submit. instead of executing code when sheet modified (function onedit(e)) should execute code when form submitted.

in same docs can find exemple of how use trigger.

note: aware there 2 types of events triggers: simple ones , installed ones. onformsubit event responds installed trigger (again you'll find in docs).


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -