google apps script - I want to set up a day timer that continues to count the days as soon as any data is entered into the row of spreadsheet -



google apps script - I want to set up a day timer that continues to count the days as soon as any data is entered into the row of spreadsheet -

could please help me fallowing question?

i set spreadsheet relate question below https://docs.google.com/spreadsheets/d/1sp8j2znzzr-lnkmpnyt_aukkm7vqf_31tq71de_xr04/edit?usp=sharing

(im not sure fallowing possible. please advise)

i want set day timer continues count days info entered row , stop when type word "x" or improve checkmark in checkbox. 1 time check mark or type word, want entire row greyout/blackout (highlight black)

i trying set sheet work , appreciate help.

to give more detail, built form through google utilize jot downwards called me, why called me , if high priority phone call or low priority call, if require service there machines etc... form creates spreadsheet, want able finish task phone call , checkmark or "something" blackout row letting me know have completed task, if have not, want timer telling me how long been since took call, 3hrs, 4 days, 10 days, etc... hope makes more sense

thank you

sunny rai

what you're describing totally possible!

step step, here's you'll want do...

first, decide column contains day counter. in case of example, that's column k. column k 11th column, of import later. next, we'll create function. we'll phone call daily(). in function, few things we reference "data range" of sheet -- area there stuff. phone call datarange then array of of values in sheet: formvalues next array of of background colors in sheet: formcolors then loop through values (except header) line line... if find number in column k, alter number 1 higher if not find number in column k, set 1 while looping, create changes array of background colors if found number greater or equal 10, set background color whole row black last, write changed values same spreadsheet range got them... ...and write perchance changed colors same range too once we've written function, add together time-based trigger runs daily() every day

but like? glad asked! function looks this:

function daily() { var datarange = spreadsheetapp.getactivespreadsheet().getsheetbyname('sheet1').getdatarange(); var formvalues = datarange.getvalues(); var formcolors = datarange.getbackgrounds(); (var = 1; < formvalues.length; i++) { // start on i=1 skip header row var daycount = formvalues[i][10]; // current day count on column 11, index 10 because zero-index if (daycount == '') { // if daycount isn't set... daycount = 1; } else { // otherwise, if is... daycount = daycount + 1; } formvalues[i][10] = daycount; // update original grid of values if (daycount >= 10) { // if daycount 10... (var j = 0; j < formcolors[i].length; j++) { // loop on width of form colors formcolors[i][j] = '#000000'; //change whatever background color there black } //end j } //end if daycount>=10 } //end /* @ point, formvalues , formcolors contain should in sheet row */ datarange.setvalues(formvalues).setbackgrounds(formcolors); // update range our new values }

remember must create trigger in resources > current project's triggers. set trigger run daily time-driven event, configured day timer whenever won't working. you're done!

google-apps-script spreadsheet

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -