I am configuring a Learning Management System that has a master table of all trainings that could be assigned, which are then linked to an "employee type" table that contains every possible role. This is a modified re-creation of the "create new tasks for certain project type" script/tutorial found here: https://youtu.be/zHQjljEov30
I was able to repurpose the script to create new tasks but I just realized, I think that the script is ignoring applicable trainings that are linked to multiple employee types. I am pretty sure the way the script is filtering through the templates is to blame. This section is what I think I need to fix. I am new to scripting and I'm not sure if there is a different way to basically say "if any linked records in "employee type" for task match the specified employee, return that task" Since right now I think it is only reading the first linked record employee type... does this make any sense? I can definitely link the whole base/script if unclear 🙂 How do I tell my script to consider template trainings that might be assigned to multiple roles?
let templateTrainings = allTemplateTrainings.records.filter(templateTraining => {
// Check whether action Items matching request
return templateTraining.getCellValueAsString("Employee Type") === employee.employeeType[0]
});