Ton of updates to Cin7's academy. Notes for Artera, SPS, and Walmart. Re-downloaded the final CSV parser.

This commit is contained in:
Norm Rasmussen
2024-02-14 17:12:33 -05:00
parent d087f41e5e
commit 839f32424c
18 changed files with 257 additions and 155 deletions

View File

@ -8,18 +8,18 @@
class="learning-path-card-image" class="learning-path-card-image"
/> />
{% if course.ribbon %} {% if course.ribbon %}
<div class="np-card-ribbon" {% if course.ribbon == "Omni" %} style="background: #0026b2;"{% endif %}> <div class="np-card-ribbon" {% if course.ribbon == "Omni" %} style="background: #0026b2;"
{% elsif course.ribbon == "Core"%} style="background: #05CBBF"
{% endif %}>
{{ course.ribbon }} {{ course.ribbon }}
</div> </div>
{% endif %} {% endif %}
</div> </div>
<div class="card-content"> <div class="card-content">
<div class="card-type">COURSE <i class="far fa-graduation-cap"></i></div>
<h3 class="card-content-title course-name"> <h3 class="card-content-title course-name">
{{ course.name }} {{ course.name }}
</h3> </h3>
{% comment %} <div class="recommended">
Recommended for:<br>{{course.properties.audience}}
</div> {% endcomment %}
<div class="course-desc"> <div class="course-desc">
{{ course.short_description }} {{ course.short_description }}
</div> </div>
@ -28,13 +28,14 @@
<div class="course-time"> <div class="course-time">
<i class="far fa-clock"></i> <i class="far fa-clock"></i>
{{course.properties.course_duration}} min {{course.properties.course_duration}} min
</div> </div>
{% endif %} {% endif %}
{% comment %} {% if course.properties.recommended_for %} {% unless course.properties.audience == 'missing property: audience' %}
<div class="recommended"> <div class="recommended">
Recommended For: {{course.properties.recommended_for}} <i class="far fa-users"></i>
</div> {{course.properties.audience}}
{% endif %} {% endcomment %} </div>
{% endunless %}
</div> </div>
</div> </div>
</a> </a>

View File

@ -6,8 +6,16 @@
class="learning-path-card-image" class="learning-path-card-image"
src="{{ learning_path.image_url }}" src="{{ learning_path.image_url }}"
/> />
<div class="np-card-ribbon" {% if learning_path.name contains "Omni" %} style="background: #0026b2;"{% endif %}>
{% if learning_path.name contains "Omni" %}
Omni
{% elsif learning_path.name contains "Core" %}
Core
{% endif %}
</div>
</div> </div>
<div class="card-content"> <div class="card-content">
<div class="card-type">LEARNING PATH <i class="far fa-road"></i></div>
<h3 class="card-content-title"> <h3 class="card-content-title">
{{ learning_path.name }} {{ learning_path.name }}
</h3> </h3>

View File

@ -1,12 +1,13 @@
{% assign omni = false %} {% assign omni = false %}
{% assign core = false %} {% assign core = false %}
{% assign log_out = true %}
{% if current_person.signed_in? %} {% if current_person.signed_in? %}
{% assign signed_in = true %} {% assign log_out = false %}
{% for group in current_person.groups %} {% for group in current_person.groups %}
{% if group.id == '9daeef1e-bd6c-47da-a343-ef772ba88300' %} {% if group.name contains 'Core' %}
{% assign core = true %} {% assign core = true %}
{% elsif group.id == 'afa31e2d-646e-4b7e-b65e-c426dc30ec5c' %} {% elsif group.name contains 'Omni' %}
{% assign omni = true %} {% assign omni = true %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View File

@ -38,6 +38,21 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div> </div>
{%elsif log_out%}
<div class="filter-option-container" id="categoryFilters">
{% assign unique_core_categories = "" %}
{% for course in courses.in_catalog %}
{% for category in course.categories %}
{% unless unique_core_categories contains category.name %}
<div class="category-option">
<input class="filter-checkbox" type="checkbox" id="{{category.name}}" />
<label>{{category.name}}</label>
</div>
{% assign unique_core_categories = unique_core_categories | append: category.name %}
{% endunless %}
{% endfor %}
{% endfor %}
</div>
{% endif %} {% endif %}
</div> </div>
<div class="fiter-duration"> <div class="fiter-duration">

View File

@ -1,11 +1,13 @@
{% assign omni = false %} {% assign omni = false %}
{% assign core = false %} {% assign core = false %}
{% assign log_out = true %}
{% if current_person.signed_in? %} {% if current_person.signed_in? %}
{% assign log_out = false %}
{% for group in current_person.groups %} {% for group in current_person.groups %}
{% if group.id == '9daeef1e-bd6c-47da-a343-ef772ba88300' %} {% if group.name contains 'Core' %}
{% assign core = true %} {% assign core = true %}
{% elsif group.id == 'afa31e2d-646e-4b7e-b65e-c426dc30ec5c' %} {% elsif group.name contains 'Omni' %}
{% assign omni = true %} {% assign omni = true %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
@ -18,8 +20,8 @@
<div class="np-footer-navigation"> <div class="np-footer-navigation">
<ul class="np-footer-navigation-list"> <ul class="np-footer-navigation-list">
<div class="footer-heading lora">Resources</div> <div class="footer-heading lora">Resources</div>
<li class="np-footer-navigation-item"> {% if omni %}
{% if omni %} <li class="np-footer-navigation-item">
<a <a
class="np-footer-navigation-link" class="np-footer-navigation-link"
href="https://connect.cin7.com/s/knowledge" href="https://connect.cin7.com/s/knowledge"
@ -27,7 +29,9 @@
> >
Knowledge Base Knowledge Base
</a> </a>
{% else %} </li>
{% elsif core %}
<li class="np-footer-navigation-item">
<a <a
class="np-footer-navigation-link" class="np-footer-navigation-link"
href="https://support.dearsystems.com/" href="https://support.dearsystems.com/"
@ -35,8 +39,27 @@
> >
Knowledge Base Knowledge Base
</a> </a>
{% endif %} </li>
</li> {% elsif log_out %}
<li class="np-footer-navigation-item">
<a
class="np-footer-navigation-link"
href="https://connect.cin7.com/s/knowledge"
target="_blank"
>
Knowledge Base Omni
</a>
</li>
<li class="np-footer-navigation-item">
<a
class="np-footer-navigation-link"
href="https://support.dearsystems.com/"
target="_blank"
>
Knowledge Base Core
</a>
</li>
{% endif %}
<li class="np-footer-navigation-item"> <li class="np-footer-navigation-item">
<a <a
class="np-footer-navigation-link" class="np-footer-navigation-link"

View File

@ -28,8 +28,14 @@
courseElement.textContent = modifiedCourseName; courseElement.textContent = modifiedCourseName;
}); });
} }
function removeBadgeShadow() {
document.querySelectorAll('.card-badge').forEach(e=>{
e.parentElement.parentElement.style.boxShadow='none';
})
}
modifyCourseNames(); modifyCourseNames();
removeBadgeShadow();
}); });
</script> </script>

View File

@ -1,3 +1,18 @@
{% assign omni = false %}
{% assign core = false %}
{% assign log_out = true %}
{% if current_person.signed_in? %}
{% assign log_out = false %}
{% for group in current_person.groups %}
{% if group.name contains 'Core' %}
{% assign core = true %}
{% elsif group.name contains 'Omni' %}
{% assign omni = true %}
{% endif %}
{% endfor %}
{% endif %}
<header class="np-header np-header-color"> <header class="np-header np-header-color">
<div class="np-header-content"> <div class="np-header-content">
<div class="np-hidden-desktop np-header-mobile-menu-nav"> <div class="np-hidden-desktop np-header-mobile-menu-nav">
@ -139,13 +154,15 @@
</div> </div>
</div> </div>
{% else %} {% else %}
{% unless log_out %}
<a <a
class="np-header-sign-in np-header-desktop-nav-link np-header-font-color" class="np-header-sign-in np-header-desktop-nav-link np-header-font-color"
aria-label="{% t shared.sign_in %}" aria-label="{% t shared.sign_in %}"
href="{% route login %}" href="{% route login %}"
> >
{% t shared.sign_in %} {% t shared.sign_in %}
</a> </a>
{% endunless %}
{% endif %} {% endif %}
</div> </div>
</header> </header>

View File

@ -6,7 +6,7 @@
{% endfor %} {% endfor %}
<div class="carousel-wrapper"> <div class="carousel-wrapper">
<div class="my-badges-carousel"> <div class="my-badges-carousel">
{% include 'badges_cards' %} {% include 'badges_cards' %}
</div> </div>
{% if completed_courses == 0 %} {% if completed_courses == 0 %}
@ -60,25 +60,4 @@
.my-badges-carousel { .my-badges-carousel {
margin: 0 1rem; margin: 0 1rem;
} }
</style> </style>
<style>
.badge-card-image {
width: 60%;
}
.card-badge {
background: #f8f5f2;
display: flex;
justify-content: center;
padding: 2rem;
border-radius: 20px 20px 0 0;
}
.card-content-badge {
text-align: center;
}
.completed-courses {
margin-top: 10px;
font-weight: 500;
color: #002f6f;
}
</style>

View File

@ -1,3 +1,4 @@
{% if result.type == 'course' %}
<div class="np-card np-search-result"> <div class="np-card np-search-result">
<div class="np-card-container"> <div class="np-card-container">
<div class="np-card-content"> <div class="np-card-content">
@ -17,3 +18,4 @@
</div> </div>
</div> </div>
</div> </div>
{%endif%}

View File

@ -1,13 +1,11 @@
{% assign omni = false %} {% assign omni = false %}
{% assign core = false %} {% assign core = false %}
{% assign log_out = true %}
{% if current_person.signed_in? %} {% if current_person.signed_in? %}
{% assign log_out = false %}
{% for group in current_person.groups %} {% for group in current_person.groups %}
{% if group.id == '9daeef1e-bd6c-47da-a343-ef772ba88300' %}
{% assign core = true %}
{% elsif group.id == 'afa31e2d-646e-4b7e-b65e-c426dc30ec5c' %}
{% assign omni = true %}
{% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}

View File

@ -1,11 +1,13 @@
{% assign omni = false %} {% assign omni = false %}
{% assign core = false %} {% assign core = false %}
{% assign log_out = true %}
{% if current_person.signed_in? %} {% if current_person.signed_in? %}
{% assign log_out = false %}
{% for group in current_person.groups %} {% for group in current_person.groups %}
{% if group.id == '9daeef1e-bd6c-47da-a343-ef772ba88300' %} {% if group.name contains 'Core' %}
{% assign core = true %} {% assign core = true %}
{% elsif group.id == 'afa31e2d-646e-4b7e-b65e-c426dc30ec5c' %} {% elsif group.name contains 'Omni' %}
{% assign omni = true %} {% assign omni = true %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View File

@ -1,11 +1,13 @@
{% assign omni = false %} {% assign omni = false %}
{% assign core = false %} {% assign core = false %}
{% assign log_out = true %}
{% if current_person.signed_in? %} {% if current_person.signed_in? %}
{% assign log_out = false %}
{% for group in current_person.groups %} {% for group in current_person.groups %}
{% if group.id == '9daeef1e-bd6c-47da-a343-ef772ba88300' %} {% if group.name contains 'Core' %}
{% assign core = true %} {% assign core = true %}
{% elsif group.id == 'afa31e2d-646e-4b7e-b65e-c426dc30ec5c' %} {% elsif group.name contains 'Omni' %}
{% assign omni = true %} {% assign omni = true %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
@ -21,8 +23,10 @@
<div class="hero-text lora">Welcome to Cin7 Core Academy</div> <div class="hero-text lora">Welcome to Cin7 Core Academy</div>
{% elsif omni %} {% elsif omni %}
<div class="hero-text lora">Welcome to Cin7 Omni Academy</div> <div class="hero-text lora">Welcome to Cin7 Omni Academy</div>
{% else %} {% elsif log_out %}
<div class="hero-text lora">Welcome to Cin7 Academy</div> <div class="hero-text lora">Welcome to Cin7 Academy</div>
{% else %}
<div class="hero-text lora">Welcome to Cin7 Academy</div>
{% endif %} {% endif %}
<div class="hero-subheading">Learn to create and manage a best-in-class inventory operation for your business.</div> <div class="hero-subheading">Learn to create and manage a best-in-class inventory operation for your business.</div>
</div> </div>
@ -38,8 +42,17 @@
{% elsif omni %} {% elsif omni %}
<div class="heading lora">New to Cin7 Omni? Start learning here!</div> <div class="heading lora">New to Cin7 Omni? Start learning here!</div>
<div class="section-content"> <div class="section-content">
{% include "category_carousel"%} {% include "category_carousel"%}
</div> </div>
{% elsif log_out %}
<div class="heading lora">New to Cin7 Core? Start learning here!</div>
<div class="section-content">
{% include 'learning_path_carousel' %}
</div>
<div class="heading lora">New to Cin7 Omni? Start learning here!</div>
<div class="section-content">
{% include "category_carousel"%}
</div>
{% endif %} {% endif %}
</div> </div>
<div class="section np-max-width"> <div class="section np-max-width">

View File

@ -1,11 +1,13 @@
{% assign omni = false %} {% assign omni = false %}
{% assign core = false %} {% assign core = false %}
{% assign log_out = true %}
{% if current_person.signed_in? %} {% if current_person.signed_in? %}
{% assign log_out = false %}
{% for group in current_person.groups %} {% for group in current_person.groups %}
{% if group.id == '9daeef1e-bd6c-47da-a343-ef772ba88300' %} {% if group.name contains 'Core' %}
{% assign core = true %} {% assign core = true %}
{% elsif group.id == 'afa31e2d-646e-4b7e-b65e-c426dc30ec5c' %} {% elsif group.name contains 'Omni' %}
{% assign omni = true %} {% assign omni = true %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View File

@ -85,9 +85,9 @@ body {
color: #002f6f; color: #002f6f;
font-size: 1.25rem; font-size: 1.25rem;
margin: 0; margin: 0;
height: 46px;
} }
.course-time { .course-time {
margin-top: 15px;
color: #000000b5; color: #000000b5;
display: flex; display: flex;
align-items: center; align-items: center;
@ -96,6 +96,7 @@ body {
.course-desc { .course-desc {
margin-top: 15px; margin-top: 15px;
color: #002f6f; color: #002f6f;
height: 60px;
} }
.lp-link { .lp-link {
text-decoration: none; text-decoration: none;
@ -188,7 +189,7 @@ body {
margin-top: 20px; margin-top: 20px;
} }
.card { .card {
margin: 10px; margin: 10px;
} }
.right-arrow { .right-arrow {
@ -391,7 +392,7 @@ body {
.np-footer-top { .np-footer-top {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items:flex-start; align-items:flex-start;
} }
.np-footer-navigation-list { .np-footer-navigation-list {
@ -473,31 +474,28 @@ body {
width: 60%; width: 60%;
} }
.card-badge { .card-badge {
background: #f8f5f2; background: #FFFFFF;
display: flex; display: flex;
justify-content: center; justify-content: center;
padding: 2rem; padding: 2rem;
border-radius: 20px 20px 0 0; border-radius: 20px 20px 0 0;
} }
.card-category { .card-category {
background: #002f6f; background: #002f6f;
display: flex; display: flex;
justify-content: center; justify-content: center;
padding: 2rem; padding: 2rem;
border-radius: 20px 20px 0 0; border-radius: 20px 20px 0 0;
} }
.card-content-badge { .card-content-badge {
text-align: center; text-align: center;
padding: 0;
} }
.completed-courses { .completed-courses {
margin-top: 10px; margin-top: 10px;
font-weight: 500; font-weight: 500;
color: #002f6f; color: #002f6f;
} }
.recommended {
margin-top: 10px;
color: #000000b5;
}
.np-header-desktop-nav-list { .np-header-desktop-nav-list {
justify-content: end; justify-content: end;
} }
@ -506,9 +504,28 @@ body {
} }
.recommended .recommended
{ {
font-weight: 600; color: #000000b5;
color: #002f6f; }
.card-type
{
color: #000000b5;
text-align: end;
margin-bottom: 10px;
font-size: 0.85rem; font-size: 0.85rem;
font-weight: 600;
opacity: 0.75;
}
.course-details {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 15px;
gap: 10px
}
.card:hover {
transform: translateY(-0.125rem);
} }
@media only screen and (max-width: 768px) { @media only screen and (max-width: 768px) {
@ -543,4 +560,4 @@ body {
position: relative; position: relative;
margin-bottom: 20px; margin-bottom: 20px;
} }
} }

View File

@ -139,3 +139,29 @@ Jackie is OUT as of 22nd.
* These partners need better metrics. * These partners need better metrics.
* Can they do a scheduled report? * Can they do a scheduled report?
* Filters for the report? She's not sure. * Filters for the report? She's not sure.
## 02/14/2024
### New Year, new meetings
Goals for 2024:
* She will get this to me
* CKO is in March, that's when they will get a "lay of the land" for the company.
Needs for 2024:
* Mini coursework
* Role-specific courses
* Wants to see the next 6 months roadmap
* Would love to see a public product board and/or community to up-vote ideas.
* Update URL to a new custom domain.
* TODO: Send Emily and Jackie the steps for updating their domain to Artera.
Red Flags:
* Analytics "are the worst they have ever seen in an LMS"
* Average Course Completion across _all_ courses needs to be customized in Google Sheets
* Manual calculations are needed
* They use Looker, so comparatively Northpass is limited.
* They want to know more about Enterprise analytics.
* Learning Paths not available to Managers is "bizarre"
* Admin Console for who has changed what, who has updated the course, being able to view version history, etc.
* Workflow - uploading SCORM file directly to course. Editing and uploading quizzes directly to a course.

View File

@ -169,5 +169,5 @@ Be to sure to ask how the redesign is going and how the User Journey/Flow is pro
- They want Gainsight to be much more robust, but it all depends on the data. - They want Gainsight to be much more robust, but it all depends on the data.
- Very interested in the analytics extract and they know it is a paid service. - Very interested in the analytics extract and they know it is a paid service.
TODO: Create new report in Looker for Kayla/Kathleen. Kayla to send the filter params. Pulled Monthly, but for all time. DONE: Create new report in Looker for Kayla/Kathleen. Kayla to send the filter params. Pulled Monthly, but for all time.
TODO: Test [this video](https://www.youtube.com/watch?v=WMFEMn2-O9E) in Northpass and ensure no ads show up. DONE: Test [this video](https://www.youtube.com/watch?v=WMFEMn2-O9E) in Northpass and ensure no ads show up.

View File

@ -955,5 +955,13 @@ Travis question re: Context Aware screens:
Expectations? None really. These are new metrics that they haven't seen before - no KPIs yet. Expectations? None really. These are new metrics that they haven't seen before - no KPIs yet.
They have some internal funnels to break it out by category. They have some internal funnels to break it out by category.
What does Travis want to see improve when we pull these numbers next quarter? What does Travis want to see improve when we pull these numbers next quarter?
* Segmentation of resource overview * Segmentation of resource overview
* Content Authoring - fewer activities, are we using all features, * Content Authoring - fewer activities, are we using all features
## 02/14/2024
### Design - Scroll over Click
Sounds like they want us to be more of a CMS.
They would like more scrollable content and less clickable content.

View File

@ -11,7 +11,7 @@ async function prepareSheet() {
} }
} }
function main(previousLast) { function main() {
var folder = DriveApp.getFolderById("1hAz7O-eoxFUk4YW7FoHr4uNJmPs7CiV5BjBNTLtMJzXwY0CbpykYgSAkFR5Quy_MPdn3e_5j"); var folder = DriveApp.getFolderById("1hAz7O-eoxFUk4YW7FoHr4uNJmPs7CiV5BjBNTLtMJzXwY0CbpykYgSAkFR5Quy_MPdn3e_5j");
var files = folder.getFiles(); var files = folder.getFiles();
while (files.hasNext()) { while (files.hasNext()) {
@ -103,6 +103,7 @@ function austinComparseData(outdated_data, updated_data) {
} }
function updatedDomainsOnly(domains_to_update) { function updatedDomainsOnly(domains_to_update) {
Logger.log(domains_to_update)
for (var x = 0; x < domains_to_update.length; x++) { for (var x = 0; x < domains_to_update.length; x++) {
var array = domains_to_update[x]; var array = domains_to_update[x];
for (var i = 1; i < array.length; i++) { for (var i = 1; i < array.length; i++) {
@ -128,105 +129,88 @@ function updatedDomainsOnly(domains_to_update) {
} }
} }
} }
replaceOnSheet(array);
let tmpArray = array;
const dom = array.shift(); const dom = array.shift();
const groups = array; const groups = array;
//sendWebhook({domain_to_update : { domain: dom, group_ids: groups }}) Logger.log("{domain_to_update : {domain :"+dom+", group_ids : "+groups+" }}")
sendWebhook({domain_to_update : { domain: dom, group_ids: groups }})
replaceOnSheet(tmpArray);
} }
} }
function replaceOnSheet(array) { function replaceOnSheet(tmpArray) {
var ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1Kck1UUOkVIU4kbBC8b_bl77fNaCTSFStiv0I5Gg-kIc/'); var ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1Kck1UUOkVIU4kbBC8b_bl77fNaCTSFStiv0I5Gg-kIc/');
var sheet = ss.getActiveSheet() var sheet = ss.getActiveSheet()
var dataRow = Math.max(sheet.getLastRow(),1); var dataRow = Math.max(sheet.getLastRow(),1);
let dom = array.shift(); let domain = tmpArray.shift();
let groups = array; let groupIds = tmpArray;
Logger.log(dom) Logger.log(domain)
let boo = sheet.createTextFinder(dom).findNext() let boo = sheet.createTextFinder(domain).findNext()
if (boo != null ) { if (boo != null ) {
group2 = [] group2 = []
currCell = boo.getRowIndex(); currCell = boo.getRowIndex();
groups.forEach(item => { if (item.length > 0) { group2.push(item) }}); groupIds.forEach(item => { if (item.length > 0) { group2.push(item) }});
group2 = [group2]; group2 = [group2];
Logger.log(group2); //Logger.log(group2);
sheet.getRange(currCell, 1).setValue(dom); sheet.getRange(currCell, 1).setValue(domain);
sheet.getRange(currCell, 2, 1, group2[0].length).setValues(group2) sheet.getRange(currCell, 2, 1, group2[0].length).setValues(group2)
// groups.forEach((item) => sheet.getRange(currCell, 2, 1, groups.length).setValue(item));
// groups.forEach((element) => Logger.log(element))
//sheet.getRange(currCell, 2,).setValue(groups);
} else { } else {
groups.forEach(item => { if (item.includes("")){ } else { group2.push(item) }}); groupIds.forEach(item => { if (item.includes("")){ } else { group2.push(item) }});
Logger.log(group2); //Logger.log(group2);
sheet.getRange(dataRow+1, 1).setValue(dom); sheet.getRange(dataRow+1, 1).setValue(domain);
sheet.getRange(dataRow+1, 2, 1, group2[0].length).setValues(group2) sheet.getRange(dataRow+1, 2, 1, group2[0].length).setValues(group2)
//sheet.getRange(dataRow + 1, 1).setValue(dom);
// groups.forEach((item,index,array) => array[index] = [item]);
// groups.forEach((item) => sheet.getRange(dataRow+1, 2, 1, groups.length).setValue(item));
// groups.forEach((element) => Logger.log(element))
//sheet.getRange(dataRow + 1, 2).setValue(groups)
} }
// var searchResult = columnValues.findIndex(([r]) => r == dom);
// if(searchResult != -1) {
// sheet.getRange(searchResult + 2, 1)
// } else {
// sheet.getRange(dataRow + 1, 1).setValue(dom);
// sheet.getRange(dataRow + 1, 2).setValue(groups)
// }
} }
function fullParse(full_data, previousLast) { // function fullParse(full_data, previousLast) {
for (var x = 1; x < full_data.length; x++) { // for (var x = 1; x < full_data.length; x++) {
var array = full_data[x]; // var array = full_data[x];
for (var i = 1; i < array.length; i++) { // for (var i = 1; i < array.length; i++) {
var item = array[i] // var item = array[i]
if (item != "") { // if (item != "") {
var api_url = 'https://api.northpass.com/v2/groups/?filter[name][eq]='+encodeURIComponent(item); // var api_url = 'https://api.northpass.com/v2/groups/?filter[name][eq]='+encodeURIComponent(item);
const settings = { // const settings = {
async: true, // async: true,
crossDomain: true, // crossDomain: true,
method: 'GET', // method: 'GET',
headers: { // headers: {
accept: 'application/json', // accept: 'application/json',
'X-Api-Key': apiKey // 'X-Api-Key': apiKey
} // }
}; // };
const sendMsg = UrlFetchApp.fetch(api_url, settings); // const sendMsg = UrlFetchApp.fetch(api_url, settings);
var uuidResponse = sendMsg.getContentText(); // var uuidResponse = sendMsg.getContentText();
var parseData = JSON.parse(uuidResponse) // var parseData = JSON.parse(uuidResponse)
Logger.log("Current Check:"+item) // //Logger.log("Current Check:"+item)
var groupID = parseData['data'][0]['id'] // var groupID = parseData['data'][0]['id']
var groupName = array.indexOf(item); // var groupName = array.indexOf(item);
if (groupName != -1) { // if (groupName != -1) {
array[groupName] = groupID; // array[groupName] = groupID;
} // }
} // }
} // }
const dom = array.shift(); // const dom = array.shift();
const groups = array; // const groups = array;
previousLast++ // writeDataToSheet(dom, groups)
Logger.log("PrevLast: "+previousLast) // }
updateLog(previousLast) // }
writeDataToSheet(dom, groups)
}
}
//Inserts a new sheet and writes a 2D array of data in it //Inserts a new sheet and writes a 2D array of data in it
function writeDataToSheet(dom, groups) { // function writeDataToSheet(dom, groups) {
Logger.log("Domain: "+dom+"and groups: "+groups) // var ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1Kck1UUOkVIU4kbBC8b_bl77fNaCTSFStiv0I5Gg-kIc/');
var ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1Kck1UUOkVIU4kbBC8b_bl77fNaCTSFStiv0I5Gg-kIc/'); // var sheet = ss.getActiveSheet()
var sheet = ss.getActiveSheet() // var dataRow = Math.max(sheet.getLastRow(),1);
var dataRow = Math.max(sheet.getLastRow(),1); // sheet.insertRowAfter(dataRow+1);
Logger.log(dataRow); // sheet.getRange(dataRow+1, 1).setValue(dom);
sheet.insertRowAfter(dataRow+1); // for (var g = 0; g < groups.length; g++) {
sheet.getRange(dataRow+1, 1).setValue(dom); // sheet.getRange(dataRow+1, g+2).setValue(groups[g]);
for (var g = 0; g < groups.length; g++) { // }
sheet.getRange(dataRow+1, g+2).setValue(groups[g]); // }
}
}
function sendWebhook(domain_to_update){ function sendWebhook(domain_to_update){
Logger.log("Webhook function Object: "+JSON.stringify(domain_to_update)) //Logger.log("Webhook function Object: "+JSON.stringify(domain_to_update))
var payload = domain_to_update var payload = domain_to_update
var options = { var options = {
'method': 'post', 'method': 'post',