Google Scripts for Talkspace & Doximity. SOme walmart notes

This commit is contained in:
Norm Rasmussen
2023-06-07 15:22:27 -04:00
parent e924fdb040
commit f4faed7dc1
11 changed files with 81 additions and 26 deletions

Binary file not shown.

View File

@ -17,6 +17,7 @@
<div class="np-card-content-subtitle"> <div class="np-card-content-subtitle">
{{ course.instructor_names }} {{ course.instructor_names }}
</div> </div>
{% include "course_details"%}
<div class="np-card-content-footer"> <div class="np-card-content-footer">
<div class="np-card-content-progress np-button-color"> <div class="np-card-content-progress np-button-color">
{% t shared.progress, count: course.progress %} {% t shared.progress, count: course.progress %}

View File

@ -38,4 +38,5 @@
<option class="second-login-group-option" value="2a0100e6-2cd3-4f14-9706-ddadb95e9cb3">Tim Lavin Accounts</option> <option class="second-login-group-option" value="2a0100e6-2cd3-4f14-9706-ddadb95e9cb3">Tim Lavin Accounts</option>
<option class="second-login-group-option" value="58309856-2659-465b-83bc-9462be60c125">Tyler Schaaf Accounts</option> <option class="second-login-group-option" value="58309856-2659-465b-83bc-9462be60c125">Tyler Schaaf Accounts</option>
<option class="second-login-group-option" value="da7a064a-da24-4011-b7ba-ffa33586d36c">Mizuno Canada</option> <option class="second-login-group-option" value="da7a064a-da24-4011-b7ba-ffa33586d36c">Mizuno Canada</option>
<option class="second-login-group-option" value"1ee46f9a-8a38-4c18-ac27-4578e8cc5dbf">Chris Nugent Accounts</option>
</select> </select>

View File

@ -38,4 +38,5 @@
<option class="second-login-group-option" value="2a0100e6-2cd3-4f14-9706-ddadb95e9cb3">Tim Lavin Accounts</option> <option class="second-login-group-option" value="2a0100e6-2cd3-4f14-9706-ddadb95e9cb3">Tim Lavin Accounts</option>
<option class="second-login-group-option" value="58309856-2659-465b-83bc-9462be60c125">Tyler Schaaf Accounts</option> <option class="second-login-group-option" value="58309856-2659-465b-83bc-9462be60c125">Tyler Schaaf Accounts</option>
<option class="second-login-group-option" value="da7a064a-da24-4011-b7ba-ffa33586d36c">Mizuno Canada</option> <option class="second-login-group-option" value="da7a064a-da24-4011-b7ba-ffa33586d36c">Mizuno Canada</option>
<option class="second-login-group-option" value"1ee46f9a-8a38-4c18-ac27-4578e8cc5dbf">Chris Nugent Accounts</option>
</select> </select>

View File

@ -494,3 +494,10 @@ Charlie couldn't replicate. Franklin didn't notice it happening on all videos.
TODO: Ask Cam for an update on all the cover images and gifs in a single zip file. Whatever he has named the file is TODO: Ask Cam for an update on all the cover images and gifs in a single zip file. Whatever he has named the file is
okay. okay.
## 06/07/2023
### Reviewing Aditi's Resource Bundle & SCORM items
* Next month's will go out on the 30th.
TODO: Work with Cassie before the 30th to get SCORM versions decoupled.

View File

@ -0,0 +1 @@
{"scriptId":"13jMb_qCijEsEwZMcsx28oYQrKEKm-HlE0yKkz7xLOWmcykwK9YZz_nDG","rootDir":"/Users/normrasmussen/Documents/Work/Scripts/GoogleScripts/Doximity"}

View File

@ -0,0 +1,7 @@
{
"timeZone": "America/New_York",
"dependencies": {
},
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8"
}

View File

@ -0,0 +1,15 @@
function addVlookFormula() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
Utilities.sleep(10000)
var value = sheet.getRange(2,2).getValue();
if (value != "Is People Manager?") {
sheet.insertColumnAfter(1);
sheet.getRange(2,2).setValue("Is People Manager?");
lastRow = sheet.getLastRow();
for(var i=3; i<lastRow;i++){
sheet.getRange(i,2).setFormula('=VLOOKUP(A'+i+', Assignments!$B:$C, 2, false)');
};
}
}

View File

@ -15,8 +15,9 @@ function checkBamboo() {
var parseProps = JSON.parse(txtResponse); var parseProps = JSON.parse(txtResponse);
var switched_on = parseProps["data"]["attributes"]["switched_on"]; var switched_on = parseProps["data"]["attributes"]["switched_on"];
var configured = parseProps["data"]["attributes"]["configured"]; var configured = parseProps["data"]["attributes"]["configured"];
console.log(switched_on)
console.log(configured) var now = new Date();
var datetime = Utilities.formatDate(now, 'America/New_York', 'MM/dd/yyyy - HH:mm'); // Today
// var emailQuotaRemaining = MailApp.getRemainingDailyQuota(); // var emailQuotaRemaining = MailApp.getRemainingDailyQuota();
// console.log(emailQuotaRemaining) // console.log(emailQuotaRemaining)
@ -28,19 +29,26 @@ function checkBamboo() {
// "Your Bamboo HR Integration is currently turned off." // "Your Bamboo HR Integration is currently turned off."
// ); // );
if (switched_on == "true" && configured == "true") { if (switched_on == "false" && configured == "false") {
MailApp.sendEmail("nrasmussen@northpass.com", MailApp.sendEmail("nrasmussen@northpass.com",
"BambooHR Is Down", "BambooHR Is Down",
"Your Bamboo HR Integration is currently turned off." "Your Bamboo HR Integration is currently turned off."
); );
} }
if (switched_on == "false" && configured == "false") {
MailApp.sendEmail("jenna.cherry@talkspace.com",
"BambooHR Is Down",
"Your Bamboo HR Integration is currently turned off."
);
}
// var sheet = SpreadsheetApp.openById('1dJJ4no9j4sJ8fKvhxh6mGiailv4YyI0EsqvjJPYVtIM'); // var sheet = SpreadsheetApp.openById('1dJJ4no9j4sJ8fKvhxh6mGiailv4YyI0EsqvjJPYVtIM');
var ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1dJJ4no9j4sJ8fKvhxh6mGiailv4YyI0EsqvjJPYVtIM/'); var ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1dJJ4no9j4sJ8fKvhxh6mGiailv4YyI0EsqvjJPYVtIM/');
var sheet = ss.getActiveSheet(); var sheet = ss.getActiveSheet();
var lastRow = sheet.getLastRow()+1; var lastRow = sheet.getLastRow()+1;
console.log(lastRow) console.log(lastRow)
//sheet.getRange(lastRow, 1).setValue(datetime); sheet.getRange(lastRow, 1).setValue(datetime);
sheet.getRange(lastRow, 2).setValue(switched_on); sheet.getRange(lastRow, 2).setValue(switched_on);
sheet.getRange(lastRow, 3).setValue(configured); sheet.getRange(lastRow, 3).setValue(configured);
} }

View File

@ -26,6 +26,7 @@ function getAssignment() {
var sheet = SpreadsheetApp.getActiveSheet(); var sheet = SpreadsheetApp.getActiveSheet();
var api_url = var api_url =
'https://api.northpass.com/v2/assignments/'+assign_uid+'/submissions?page='+page; 'https://api.northpass.com/v2/assignments/'+assign_uid+'/submissions?page='+page;
Logger.log(api_url)
const settings = { const settings = {
async: true, async: true,
crossDomain: true, crossDomain: true,
@ -62,9 +63,22 @@ function getAssignment() {
var full_name = info["attributes"]["full_name"]; var full_name = info["attributes"]["full_name"];
var email = info["attributes"]["email"]; var email = info["attributes"]["email"];
let rowArray = [submit_date, download_link, person, full_name, email]; let rowArray = [submit_date, download_link, person, full_name, email];
Logger.log(rowArray); addToSheet(rowArray);
}; };
} else {
} }
page++; page++;
getAssignment(page); getAssignment(page);
}; };
function addToSheet(rowArray){
var sheet = SpreadsheetApp.getActiveSheet();
var lastRow = Math.max(sheet.getLastRow(),1);
sheet.insertRowAfter(lastRow);
sheet.getRange(lastRow + 1, 1).setValue(rowArray[0]);
sheet.getRange(lastRow + 1, 2).setValue(rowArray[3]);
sheet.getRange(lastRow + 1, 3).setValue(rowArray[4]);
sheet.getRange(lastRow + 1, 4).setValue(rowArray[1]);
}