I have a database of “tasks” with each task containing columns for things like project, name, assignee, due date, project phase, etc…
I want to create a button for each project that will create 50+ tasks according to task templates I’ve created. However, these newly created tasks have values that are relative; for example, some tasks are assigned to people referenced in that particular project, but the assignee isn’t always the same person since the person chosen will vary from project to project.
So far, I’ve been writing all of these “Addrow()” actions into the button, but since there are so many rows with so many columns per row, writing these actions is slowing Coda to unusable speeds. Is there a more efficient way I can be doing this?
For context, I’ve thought about creating template rows and using “DuplicateRows()” instead of “AddRows()”, but then the button would still have to go in and modify all of those rows to assign the appropriate assignee. So I don’t know that this would be noticeably more efficient.
Where are you storing the template? From your screen shot, it looks like you are hardcoding the task names.
How about having a template table with one row per task. Have a relation control where you select the project. Have a formula in the template table that calculates the assignee based on the relation control. Finally, have a button that loops over the template table copying the task name and assignee from the template table to your task table.
I am hardcoding the task information for now. I’ve previously tried creating a template table with one row per task as you suggested, but I haven’t been able to figure out a way to use a formula for the assignees. I know I can apply a formula to the entire “assignee” column, but as far as I can tell, I can’t apply a different formula to each row.
For example, tasks called “Consult I” would need to be assigned to members of the company’s Executive Team (always the same three people), but tasks called “Build floor plan” need to be assigned to the Lead Designer for the project (changes per project).
How would I apply formulas for these different methods of calculating the assignees on the row level (instead of applying a formula to the entire column)? Or am I misunderstanding your instructions?
You can use a more complex formula to account for different values for different rows. Switch or SwitchIf works well for this. (I find myself using SwitchIf more, but pick whichever makes the most sense to you.
You can have another single-select (or multi-select) column in your template table that says who the assignee should be: “executive team”, “lead designer”, etc.
I also do not see this being in the same table, but rather a different table. Thus, you would not be able to use DuplicateRows(). But the formula would be easier,
[Template Table].ForEach([Tasks Master].AddRows(
[Project], [relation control for selected project],
[Status], "0 Not Started",
[Task Type], "Project Workflow",
[Phase], "D+C Onboarding",
[Name], currentValue.name,
[Assignee], currentValue.assignee
))