I am new to appscript, I would like to send a email to myself as reminder 2 weeks prior the employee next review. Please see below for the Sheet. https://docs.google.com/spreadsheets/d/1SHglnLMT7enbuubed06uUL8Iy7WGjsEasPZuTT74p8I/edit?usp=sharing
I would like to receive a email 2 weeks prior the employee next review (Column F). I would like to get a email that says the Employee name (Column A) has a review coming up.
Thank you!
I have tried to look a few post, but i couldnt find anything
SOLUTION:
What this script does is on the
rangevariable, it gets the data fromrow 2column Atocolumn F, and since it returns a 2 dimensional array of those values.Using the
forEach()method, the names are located on indexx[0]and the next review date is on thex[5]index and then the conditionx[5]!= "" && datediff == 14evaluates thatx[5]should not be blank, also the variabledatediffdoes the computation for the review date minus the current date to comply with the condition set for theif condition.SAMPLE TABLE:
NOTE: I changed
F5andF6just to test if it works.EMAIL OUTPUT:
Lastly, add it as a time-driven trigger so that the script will automatically run depending on the time period you set.