Artera templates. Chubb Templates. Anthology small changes to GAS scripts.

This commit is contained in:
Norm Rasmussen
2024-07-10 16:52:16 -04:00
parent c80150b945
commit 622310f627
6 changed files with 109 additions and 23 deletions

View File

@ -6,15 +6,17 @@ function main() {
while (files.hasNext()) {
var file = files.next();
var getDate = new Date();
var date = Utilities.formatDate(getDate, 'America/New_York', 'MM/dd/yyyy hh');
var date = Utilities.formatDate(getDate, 'America/New_York', 'MM/dd/yyyy hh:mm');
var fileDate = file.getDateCreated();
var fileDateFormatted = Utilities.formatDate(fileDate, 'America/New_York', 'MM/dd/yyyy hh');
var fileDateFormatted = Utilities.formatDate(fileDate, 'America/New_York', 'MM/dd/yyyy hh:mm');
if (date == fileDateFormatted) {
Logger.log("Updated: "+file)
var updated_file = file.getBlob()
var updated_blob = updated_file.getDataAsString();
var updated_data = Utilities.parseCsv(updated_blob, ',');
var updated_data = updated_data.sort();
} else if (date != fileDateFormatted) {
Logger.log("Outdated: "+file)
var outdated_file = file.getBlob()
var outdated_blob = outdated_file.getDataAsString();
var outdated_data = Utilities.parseCsv(outdated_blob, ',');
@ -32,10 +34,10 @@ function moveOldFiles() {
while (files.hasNext()) {
var file = files.next();
var getDate = new Date();
var date = Utilities.formatDate(getDate, 'America/New_York', 'MM/dd/yyyy hh' );
var date = Utilities.formatDate(getDate, 'America/New_York', 'MM/dd/yyyy hh:mm' );
var fileDate = file.getDateCreated();
Logger.log("FILE: "+file+", DATE UPLOADED: "+fileDate)
var fileDateFormatted = Utilities.formatDate(fileDate, 'America/New_York', 'MM/dd/yyyy hh');
var fileDateFormatted = Utilities.formatDate(fileDate, 'America/New_York', 'MM/dd/yyyy hh:mm');
if (date != fileDateFormatted) {
const destination = DriveApp.getFolderById('1cIPZCgoj8XdjMIfL75QfomJAxsy2smGT');
file.moveTo(destination);
@ -147,7 +149,7 @@ function updatedDomainsOnly(domains_to_update) {
MailApp.sendEmail("nrasmussen@gainsight.com",
"Anthology has submitted a CSV",
"Here are the domains that will be updated: "+JSON.stringify(noErrorObj)+"\n\n"+"Group Errors (they likely don't exist): "+JSON.stringify(errorList));
MailApp.sendEmail("amitd@anthology.com",
MailApp.sendEmail("amitd@anthology.com",
"Anthology has submitted a CSV",
"Here are the domains that will be updated: "+JSON.stringify(noErrorObj)+"\n\n"+"Group Errors (they likely don't exist): "+JSON.stringify(errorList));
}