Getting Contains() to work with Multiselect Columns

Here’s what I’m trying to do:
‘Person’ table contains a list of people, and it contains a multiselect column for skills. This multiselect column is looking up the skills from a separate table.
I want to create a view of the Skills table, for which I can use a Select tool, select a person, and the skills table view will show me just the rows for that person’s skills.

So here’s the code I attempted for the filter on this view:
[Person Table].Filter(Name=[Person Select].Name).Skills.Contains(thisRow.[Skill Name])

And this works… but only if the person has just one skill selected. If the person has two or more skills selected, this view is blank. I’ve also written a similar formula using ‘In()’, and got the same result with it. Why isn’t this working and what do I need to change to make this work for my multiselect entries?

So I think the issue is not in the formula itself but rather the control. If you are using a select list control instead of a multi-select control you get the behavior you describe.

I actually set up a test doc to replicate what you are doing and ran into the same issue - I was using image instead of image . After some frustration I tried an Interactive Filter:

Which worked and was what I was going to recommend, but it was bugging me as to why that would work and not the other method. The only difference I noticed was in the formula and how the select controls were handled differently:


I Imagine if you switch to a multi-select control your filter should start working as expected. The other option is to use the interactive filter and have Coda create the control for you.


The data types don’t match: row vs text.

Image 2020-05-20 at 10.10.13 AM

Yup - found that out when looking into this and why I provided the screenshots :slight_smile:

Woops, wasn’t reading super close. :upside_down_face:

This is a great answer because it gave me a couple different approaches to solving my problem, plus taught me something to watch for when making formulas in the future!