Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Feb 01, 2023 11:03 AM
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]
});
Feb 01, 2023 10:51 PM
If you're open to exploring a non-scripting option, Zapier can look for and create up to ten records, and you could potentially come up with a system that would run the Zap multiple times until all the records you needed got created
Best of luck with the scripting side of things though!
Feb 16, 2023 12:57 PM
Thank you for the suggestion 🙂 I am trying to avoid zapier since our org has SO many current tools, they are less willing to entertain asking for another subscription.
I really think this script can work for what I am aiming, I'm just floundering in the mdn/javascript domain trying to figure out what I've done wrong
Feb 17, 2023 07:52 PM
Ah fair enough. Airtable just released new automation functionality that lets you repeat actions which might solve your problem? https://support.airtable.com/docs/repeating-groups-of-automation-actions
Apologies, I can't help with the script side of things as I'm pretty swamped. Hopefully someone else will be able to assist you with it
Best of luck