Hi!
I want to apply a template with a button, creating tasks and subtasks. I think it’s more or less like this post, and @anon25240232 had a solution but the document is no longer available…
Here’s an example of what I’m trying to do: https://coda.io/d/_d_NIhecvA54/Untitled-page_suV-dFXf
Thanks!!!
i had the same problem, so i also made two buttons. First you add the main tasks and then you add the subtasks. The subtask will be searching for its maintasks and add itself as subtask. here are the two codes:
-
Add maintask Button:
RunActions(
[Task Template]
.Filter(Add = True())
.Maintask.Unique()
.ForEach(
WithName(
CurrentValue,
UniqueMaintask,
AddRow(
Tasks,
Tasks.Titel, UniqueMaintask.ToText(),
Tasks.Projekt, [select project add],
Tasks.Start, [Task Template].Filter(Maintask = UniqueMaintask).First().Start,
Tasks.Termin, [Task Template].Filter(Maintask = UniqueMaintask).First().End,
Tasks.Gantt,true()
)
)
)
) -
Add Subtask
[Task Template].Filter(Add = True())
.ForEach(
WithName(
CurrentValue,
TemplateRow,
WithName(
Tasks
.Filter(
Titel = TemplateRow.Maintask AND
Projekt = [select project add]
)
.First(),
MainTaskReference,
AddRow(
Tasks,
Tasks.Projekt,
[select project add],
Tasks.Titel,
TemplateRow.Task,
Tasks.Art,
Options_Art.Filter(Art = “Unteraufgabe”),
Tasks.Maintask,
Tasks
.Filter(
Titel = TemplateRow.Maintask.ToText() AND
Projekt = [select project add]
)
,
Tasks.Start,
TemplateRow.Start,
Tasks.Termin,
TemplateRow.End
))
)
)
Hope that helps
Thanks, @Roman_Vesely !
@Math_24 (i think…) did it with 1 button:
RunActions(
[Templates - Tasks].Filter(Area == thisRow.Area)
.ForEach(
AddRow(
Tasks,
Tasks.Task,
CurrentValue.Task,
Tasks.Week,
thisRow
)
),
Tasks
.Filter(
Week == thisRow && Subtasks.IsBlank()
)
.ForEach(
let(
CurrentValue,
tmp_task,
[Templates - Subtasks]
.Filter(
Tasks.ToText() ==
tmp_task.Task.ToText()
)
.ForEach(
AddRow(
Subtasks,
Subtasks.Task,
tmp_task,
Subtasks.Subtask,
CurrentValue.Subtasks
)
)
)
)
)
Thank you, @Math_24 !
Hey,
yes it’s me, no problem