The following produces a date with timestamp
var time = new Date();
What could I use to create just a date i.e. 2020/1/18 (Without time stamp) ?
The following produces a date with timestamp
var time = new Date();
What could I use to create just a date i.e. 2020/1/18 (Without time stamp) ?
Here you goâŚ
function get_today() {
var date = new Date();
var str =
date.getFullYear() + "/" +
(date.getMonth() + 1) + "/" +
date.getDate();
return str;
}
Called as:
function moo() {
console.log("Today is %s", get_today());
}
Produces:
7:48:48 AM Notice Execution started
7:48:46 AM Info Today is 2021/1/19
7:48:49 AM Notice Execution completed
@ehdubya @Wiz.Wazeer - I found a bug in this script. I fixed it, see the edit in my original post.
Im going to be testing this on the glide countdown timerâŚI am sure this could help me unlock something (fingers crossed)!
Just out of curiosity, what is the problem that youâre hoping this might solve?
Thank you! Iâl give it a go now
Currently its a combination of numbers and texts. Yours generates numbers only. Glide instantly recognizes that and therefore I can play around with duration cell in the sheet. At present the moment you press pause it all disappears. With yours I want to see if I can keep it in the cell. Then I can truly play around with the countdown timer.
Not sure I understand, but okayâŚ
Let me know if I can help in any way.
Its just me and my weird ways âŚBut I know you will be able to assistâŚIf you canât then I have no hope lol
@Wiz.Wazeer sorry man, I havenât been on a ton this past week. What are you trying to do in scripts again?
Solved for now! I am working on something âŚI have managed to create a dynamic calendar using sheet formulas. when x types in 1-12, it will show the corresponding month and all slots for that particular month. I was looking for a script to send bulk emails to several contract workers (cleaning industry)âŚon selection. Found the script. But if I get stuck I will let you guys know.
Thanks and take it easy on yourself (saw you on CNN with a capitol C, i thinkâyou know what I mean )
It would be cool if we can send a email based on event, Like reminder a day before then 1 Hour before. Or in the morning everyday at 9:00 If date is today. you get the point.
Example can be, IF(Job Completed) = Never Remind me.
else, If Start is (Today) Then Reminder & set col + 1 ( for first reminder) , then Repeat hour before, So on.
we can even add to script. If End is past. (Was the job Done col) will be checked. If a user unchecked it will reset and resend email. Any thoutes about this?
Yes, all possible and fairly straight forward.
Scenario 1: Send an email on a regular schedule (once per day, per hour, etc)
Scenario 2: Send an email as a result of an event - ie. when something significant changes
I use both scenarios. Horses for courses
OK need help convert this to
Instead of HardCoded Col, Lets change it to read headers Instead.
Email Send email to 10 Col, (Allow to read 10 Col collect all emails and send it that way. )
Allow 1 header (Col) To trigger upon Edit (For Glide.)
Allow a header (col) If true Continue Script. For user to select if they want to be notified in advance.
Add If start TimeStamp ( Something like we discussed. Above, I will add hourly trigger. )
Col with time stamp, For some reasons also shows GMT-5 Easter Stander time text. Lets avoid that By stripping it?
function sendEmail() {
var name = SpreadsheetApp.getActiveSheet().getName();
var row = SpreadsheetApp.getActiveSheet().getActiveCell().getRow(); // Active Row
var columnactive = SpreadsheetApp.getActiveSheet().getActiveCell().getColumn();
var sheetname = "Quotes" // replace sheet name with your sheet name
var sheetid = "Somthing" // replace sheet ID with your sheet ID
if( name == sheetname && columnactive == 42 ) { //checks that we're on the correct sheet, replace column number if need it
var sheet = SpreadsheetApp.openById(sheetid).getSheetByName(sheetname);
//email notification
//getRange(row, column, numRows, numColumns) // Should work to collect emails? I guess not.
var email = sheet.getRange(row,32,1,10).getValue() // replace renge parameters if need it
var Title = "Today From Calendar "
var job_Type = sheet.getRange(row,8,1,1).getValue()
var The_Job = sheet.getRange(row,9,1,1).getValue()
var Note = sheet.getRange(row,10,1,1).getValue()
var Stats = sheet.getRange(row,11,1,1).getValue()
var Remarks = sheet.getRange(row,12,1,1).getValue()
var description = sheet.getRange(row,2,1,1).getValue()
var Client = sheet.getRange(row,3,1,1).getValue()
var Address = sheet.getRange(row,4,1,1).getValue()
var Phone = sheet.getRange(row,5,1,1).getValue()
var Manager_Phone = sheet.getRange(row,6,1,1).getValue()
var UserEmail = sheet.getRange(row,7,1,1).getValue()
var TimeStamp = sheet.getRange(row,29,1,1).getValue()
var Start = sheet.getRange(row,30,1,1).getValue()
var End = sheet.getRange(row,31,1,1).getValue()
MailApp.sendEmail({
to: email,
subject: Title,
body: "\n\Name: "+Client+
"\n\Phone: "+Phone+
"\n\Manager: "+Manager_Phone+
"\n\UserEmail: "+UserEmail+
"\n\nAddress: "+ Address +
"\n\Stats: "+Stats+
"\n\The_Job: "+The_Job+
"\n\job_Type: "+job_Type+
"\n\description: "+description+
"\n\Note: "+Note+
"\n\Remarks: "+Remarks+
"\n\nStart: "+Start+
"\n\End: "+End+
"\n\nTimeStamp: "+TimeStamp
});
}
}
@Darren_Murphy I would take your script that you have and try to work with it first and let you know if i can do it on my own.
@abe.sherman this is a classic example of why I donât use App Scripts to send emails. Having all those hard-coded references to specific columns is way too fragile and subject to breakage. Itâs also going to be really slow because of the multiple getRange() calls.
A much better approach (IMO, as I said in my earlier post) is to use a trigger to fire a webhook to Integromat, and then let Integromat do all the heavy lifting for you.
Is there are reason why you donât want to use something like Integromat or Zapier?
For this particular app i am not paying for yet besides the extra edits. For my other app. I can differently try using it in the future as i am paying for it. The webhook cost money and i dont have it for this app set up, Plus it wont give me everything i want to do with the webhook, Will it?
Even thou its planned in the very long run to pay for it. as of now. i dont have much clients using it besides a handfull. When the app is complete and i can intruduse it. then things will be different.
Integromat give you 1000 operations per month for free.
Iâll have a closer look later when I have a bit more free time. In the meantime, can you provide a sheet with some sample data?
Same one we used last time
Hi there
I look for an example script: need to compare two tables and if it finds a match, copy the row to the third table.
Now I have it:
function Alarm ()
{
var sheet = SpreadsheetApp.openById (âidâ);
var Data1 = sheet.getSheetByName (âFeedâ);
var Data2 = sheet.getSheetByName (âAlarm-listâ);
var Data3 = sheet.getSheetByName (âNotificationsâ);
}
Already suggested (thanks @ThinhDinh ) that it should be the expression âWhen I add to table A, if the input info matches a row in table B, write both to table A and table C, and show an in-app notification. If no, only write to table A.
Same for table B, if the input info matches a row in table A, write both to table B and table C, and show a notification. If no, only write to table B. "
But how to express it in the code - I donât know.
Help, please.