"Contains" or "In" filters should apply in new rows

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.

07%20PM

@Chris_Chua - thanks for the suggestions. I’ve raised it to the team that will work on it. Just something that we haven’t gotten to yet.

1 Like

Thanks!
This would be a game-changer for our team, since some views are now “read-only” and we cannot add new rows as they just disappear.

Thanks for the feedback!

Two questions:

  1. 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?
  2. 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
1 Like

Hi Chris,

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.

Nigel.

Hi Chris et al,

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:

  • Sprints.CONTAINS(currentSprint)
  • currentSprint.IN(Sprints)
  • Sprints.Matches(currentSprint)

Nigel.

3 Likes

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:

Chris, I tried to reproduce this and couldn’t.

My setup:

  • Table Sprints
  • Select control currentSprint bound to Sprints.
  • Table Tasks with column Sprints of type Multiselect. Linked to table Sprints
  • Filter column expression of currentSprint.IN(Sprints), Sprints.CONTAINS(currentSprint) and Sprints.Matches(currentSprint)

Can you outline the repo steps so I can figure out what’s broken?

Thanks,
Nigel

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)