Help

Script to Autopopulate Template Tasks that are linked to multiple "project" types

1032 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Diana_Lamriben
5 - Automation Enthusiast
5 - Automation Enthusiast

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]

 });

 

Welcome to Learn Airtable scripting a 4 part series where you'll learn the basics of writing scripting in Airtable. In part 2, Gio continues teaching us (and me!) the basics of how to write scripts in Airtable. We write a script to automatically create tasks for a project based off of that ...
3 Replies 3

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!

 

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

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