Hi Airtable community!
I have a base structure where:
- The first table is a list of email projects linked to a second table of tasks
- The second table contains all the tasks for the email projects in the first table, grouped into “send” dates
- A third table with a template of email tasks that are the same for each email project
I’ve implemented a script so I can generate the email template tasks with the click of a button within the first projects table:
let projectsT = base.getTable('Marketing Projects');
let tasksT = base.getTable('Project & Individual Tasks');
let taskTemplateT = base.getTable('Email Task Template');
let project = await input.recordAsync('Pick a project', projectsT);
if (project) {
output.text(`You picked ${project.getCellValueAsString('Name')}`);
output.text(`Creating tasks for ${project.getCellValueAsString('Name')} ... please wait`);
let taskTemplateQ = await taskTemplateT.selectRecordsAsync();
let projectTasks = s];
for (let task of taskTemplateQ.records) {
projectTasks.push(
{
fields: {
'Name': task.name,
'Retention Channel': { name: 'Email'},
'Task Status': { name: 'Not Started'},
'Project': e {id: project.id} ]
}
}
)
}
await tasksT.createRecordsAsync(projectTasks);
output.text('Tasks created!')
}
I’m having trouble creating another template within that third table that I can choose from when going to generate tasks via the button I have in the first table. I can’t seem to figure it out with any documentation I’ve read; is there a way to incorporate a dropdown upon running the script so that I can choose which template to trigger?