How to get a sort of "thisRow" from a second filtered table


I’m using a coda template with a button that create tasks from a template table. I want to modify it to create a Gantt timeline, where each subtask has its own start date and due date based on a “delay” and “duration” values that I created in a second table.

Currently I can get specified data from a “Name” column using a filtered formulaMap, but I do not know how I can get other columns from the same table?. Something like using the same index to get different column values from the same row.

In my button I have a “currentValue” that correspond to “Name” Column index, but I want to get also Stage, Delay and Task Duration.

Any ideas?


It would be easier to help you if you’ll embed a dummy doc in here.
From what I can see, maybe this button action will get you closer to what you want:
[subtask template].Filter([Template Category] = thisRow.Category).FormulaMap(AddRow([All Subtasks], [All Subtasks].Name, CurrentValue.Name, [All Subtasks].Task, ThisRow, [All Subtasks].[Start Date], Today() + CurrentValue.Delay, [All Subtasks].[Due Date], Today() + CurrentValue.Delay + CurrentValue.[Task Duration]))

hey @Cristian_Reynaga I think your issue is that in your original FormulaMap() formula, you are specifying .[Name] on the end of your filter. The formula returns all of the subtasks matching that category, then you further filter that result to just [Name] column.

If you omit the .[Name] on that filter, you will return the whole set of rows. Then, append the .[Name] to the CurrentValue object (which now includes the whole row of data) to return that name. This will allow you to then reuse CurrentValue and pull the other, related values out that you seek.

1 Like

Thank you! That works pretty well.

Great explanation, now I realize that “currentValue” acts as Index of a regular for loop and the first part of my code was actually “the” problem.

Thanks again!

Thanks @Johg_Ananda ! This is the perfect explanation of this code that I try to adapt to my needs.

The last parameter .Name was a black box, I could not find examples to understand how it affects the filter.

Thank you!

1 Like