When I use the Contains or In filters, the “Apply to New Rows” functionality does not apply the same filters as the equals (=) operator. When using views with these, we lose the ability to add new rows in that view since the new row immediately disappears.
Two specific use cases:
We’re using Coda as a task/sprint tracker and some tasks get assigned to multiple sprints as they span or carry over to multiple sprints.
Some tasks get assigned to multiple folks. We want to add a view where the user can see their own tasks but it should also contain tasks that are assigned to multiple folks including themselves. When we add that functionality, we lose the ability to add new rows in that view.
Which values would you expect the new row to have in that case? Would you expect it to just set Sprint(s) to be [Current Sprint].Value?
As a workaround, have you tried using a button? You might be able to set up a “Add new row” button with default values that match your expectations. Some ideas here: https://coda.io/t/Button-Starter-Kit_tlAyIaV_wR6
We currently support default values inference for equality (=) and matches (used with controls). I’m currently working in extending this to support contains and in.
Once I’m done either of the following will work:
Sprints.CONTAINS(currentSprint)
currentSprint.IN(Sprints)
In both cases we’d assign a value of List(currentSprint) to Sprints.
I’ll circle back here once the support has been added.
I’ve completed the work to support this scenario. We’ll now automatically assign a list value containing the current sprint to the sprints column when you insert through the view.
For your schema, this would work in the following scenarios:
Awesome. This mostly works, though there seems to be something odd that it’s not connecting to the lookup when it’s on a column formatted as a Lookup table:
Hey Nigel, same steps as you’ve outlined, except using column Sprints of type “Lookup” with Multiple selection instead of “Multiselect”.
Update: Everything looks good. Thank you Coda team!
I found the issue, it was user error.
I was using .Contains with an array of elements instead of the element itself, and that caused issue when I changed it from Sprints.Contains(CurrentSprint.Value) to Sprints.Contains(CurrentSprint.Value.First()) everything worked. (CurrentSprint is a table of only one row and one lookup column)