Mizuno's google script was added. Need to change a few things

This commit is contained in:
Norm Rasmussen
2023-03-01 17:06:14 -05:00
parent 1a01c317d7
commit 43c86f43ae
5 changed files with 109 additions and 0 deletions

9
CustomerNotes/Mattr.md Normal file
View File

@ -0,0 +1,9 @@
# Mattr
## 02/28/2023
### Content Strategy
Nata & Ashley - Content Strategy
MVP - 4 courses, ready by Mid-March
No involvement from Norm until the MVP launch in March. Then will review content and strategy and offer advice.

View File

@ -378,3 +378,7 @@ Krystal back in August - 6 months total.
DONE: Add to monday: MJ, Lauren, Cassie, Travis, Nichole, Felicia DONE: Add to monday: MJ, Lauren, Cassie, Travis, Nichole, Felicia
Krystal to speak to lead designer to give Cam insight as to how they design their images, that will help Cam get "in the spirit". Krystal to speak to lead designer to give Cam insight as to how they design their images, that will help Cam get "in the spirit".
## 03/01/2023
### Meeting Cassie, Lauren Hand off

View File

@ -0,0 +1 @@
{"scriptId":"1YHgQUXTmBttTnbZH1O9n5IVuX0Ymr9GIBcL2mfpLWmtvv7UhrwlJQZC_","rootDir":"/Users/normrasmussen/Documents/Work/Scripts/GoogleScripts/MizunoPGA"}

View File

@ -0,0 +1,88 @@
const sheet = SpreadsheetApp.getActiveSheet();
const apiKey = 'stXNF84HWL8aCGeRjHEo2rJ1U';
function getUuids() {
var sheet = SpreadsheetApp.getActiveSheet();
var numRows = sheet.getLastRow()-1; // Number of rows to process
var dataRange = sheet.getRange(3, 3, numRows, 1); // Column C
var values = dataRange.getValues();
writeHeadings();
for (email in values){
var row = values[email];
var email = row[0]
var api_url = 'https://api.northpass.com/v2/people/?filter[email][eq]='+email;
const settings = {
async: true,
crossDomain: true,
method: 'GET',
headers: {
accept: 'application/json',
'X-Api-Key': apiKey
}
};
const sendMsg = UrlFetchApp.fetch(api_url, settings);
var uuidResponse = sendMsg.getContentText();
var parsedata = JSON.parse(uuidResponse);
try {
var uuid = parsedata["data"][0]["id"];
if (email != "") {
findRow(email, uuid);
}
}
catch(ex) {
Logger.log(ex)
continue
}
finally {
}
};
};
function findRow(email, uuid){
var sheetRow = SpreadsheetApp.getActiveSpreadsheet();
var data = sheetRow.getDataRange().getValues();
for(var i = 0; i<data.length;i++){
if(data[i][2] == email){ //[1] because column B
// Logger.log((i+1))
var row = i+1;
propstoSheet(uuid, row);
}
}
}
function propstoSheet(uuid, row) {
var uuid_url = 'https://api.northpass.com/v2/properties/people/'+uuid;
const settings = {
async: true,
crossDomain: true,
url: uuid_url,
method: 'GET',
headers: {
accept: 'application/json',
'X-Api-Key': apiKey,
}
};
const sendMsg = UrlFetchApp.fetch(uuid_url, settings);
var txtResponse = sendMsg.getContentText();
var parseProps = JSON.parse(txtResponse);
var user_id = parseProps["data"]["attributes"]["properties"]["account_number"];
if (user_id != 0) {
// Write the Data to each row and column
sheet.getRange(row, 6).setValue(user_id);
} else {
}
}
function writeHeadings() {
// Write the new Column Headings
sheet.getRange(1, 6).setValue("PGA Number");
}
//function deleteZeros(row, user_id) {
// if (user_id == 0){
// sheet.deleteRow(row);
// }
//}

View File

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