Filtering table based on which user is looking at the doc

Hey Coda Community

So I have a problem I hope you can help me with.

I would like to filter the first table called “Case”, based on which user is looking at that table.
I’ve created another table called “Responsible”, where I can dedicate the responsible user to a project.
The field responsible in the table “Case” uses the following formula to grab the text:

Responsible.Filter(Case=thisRow.Case).Responsible

What I want to do is, if for an example:

  • I( Viet) was looking at the table called “Case”, I would only see the items in Project 3.
  • If Kasper was looking at it, he would only see the items in Project 2.
  • If Fredrik was looking at it, he would see items in both Project 2 and 3.

I can get it to work by filtering the first table with Responsible = User(), but this only works if there is one person is responsible for a case in the table “Responsible”, but as soon, as you add multiple users to a case in the table “Responsible”, it stops working.

If you could help guide me in the right direction, I would be much appreciated.

Here’s an image of the tables for reference:

Hi @Viet_Pham, can you try using Responsible.Contains(User()) and see if that works for you?

Hey @mallika

I’ve tried using:

But it doesn’t work, it returns an empty table see the image below:

Set column format of Responsible.Responsible to People. And perhaps the format of the Case.Responsible column as well. It works fine for me

Hey @Paul_Danyliuk

I’ve tried to:

But it still doesn’t work. Can you maybe show me a doc, where you do it? So I can replicate? Thanks a bunch.

Try with this one (add yourself there)

Thanks for the help @Paul_Danyliuk that solved it!

So what was the problem with your doc?

Hey @Paul_Danyliuk, the problem was that I didn’t use a lookup in the case column and got the data from the responsible column, by using this formula:

After chaning the Case Column to be a lookup type that got data from the responsible table and changing the formula in the responsible column in the case table to case.responsible it worked.

Thanks again