I’m trying to create a new view where when I click on focus, the table view changes to show everything underneath the project.
For example, if I clicked focus on brand identity, it would show all the projects until 2/ colour palette.
So basically I suppose what I’m looking to do is look at project path and show me all the projects listed under the one I’ve selected. Like look at Brand Identity’s project path, filter everything under the Brand Identity to show me (Logo, Colour palette, logo sub, extremo). I’m not sure if that makes sense
I assume you are storing the ‘focus’ status of each row in a hidden checkbox column, named ‘focussed’ or similar, and that hitting the ‘focus’ button for a row first clears all the ‘focussed’ checkboxes in the table, and then changes the value of ‘focussed’ in the current row to true? In other words, only one row in the whole table can be ‘focussed’ at any given time?
In that case you can simply set the filter condition as follows (I don’t know the name of your table, so have used [thisTable]):
thisRow.focussed
OR
[thisTable].filter(focussed).first().project path.contains(thisRow)
OR
not([thisTable].focussed.contains(true))
Apologies in advance if there are errors in the above - haven’t tested it in a doc!
What I am trying to do is find the project name that is the same as the “project focus control” (which is the copied name from when I clicked the focus button) and go to the project path. Then see the elements in the list and return the project name.
The project path has this formula:
[projects DB].Filter([child path index].StartsWith(thisRow.[child path index]))
This is such a smart idea!! But I don’t think it would be useful in this case cause clicking the focus button would redirect me to a different page with a filtered view of the table - it’s a single click type of button.
I will attempt an explanation but may be stating the obvious and/or misunderstanding what you do and don’t know about Coda - so apologies in advance just in case…
The filter condition is assessed for each row in the table. For any given row, if the result of the filter condition is true, the row will display. So when we set the filter condition as suggested above, Coda looks at each row in the table (referred to in each case as thisRow), and then looks at whatever row is referenced in the ‘project focus control’ (i.e. whichever row you selected with the focus button), and asks whether the ‘project path’ column for that row contains thisRow, i.e. the row currently being evaluated for the purposes of the filter condition. Coda steps through this process for every row in the table. For each row, your ‘project path’ column contains a reference to itself, plus the row references for all its subsidiary elements. So when the row reference is copied into the ‘project focus control’ and referenced from the filter condition, we can pull through all row references denoting the focussed row and its subsidiary elements.