diff --git a/CustomerNotes/.DS_Store b/CustomerNotes/.DS_Store index 23697770..954fdbd3 100644 Binary files a/CustomerNotes/.DS_Store and b/CustomerNotes/.DS_Store differ diff --git a/CustomerNotes/Chubb/AppScripts-Add-Property-Name.txt b/CustomerNotes/Chubb/AppScripts-Add-Property-Name.txt new file mode 100644 index 00000000..36f2c187 --- /dev/null +++ b/CustomerNotes/Chubb/AppScripts-Add-Property-Name.txt @@ -0,0 +1,85 @@ +const sheet = SpreadsheetApp.getActiveSheet(); +const apiKey = ''; + +function getUuids() { + var sheet = SpreadsheetApp.getActiveSheet(); + var numRows = sheet.getLastRow()-1; // Number of rows to process + var dataRange = sheet.getRange(3, 3, numRows, 1); + var values = dataRange.getValues(); + writeHeadings(); + + for (email in values){ + var row = values[email]; + var email = row[0] + Logger.log(email) + 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); + Logger.log(parsedata) + 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