I can't simultaneously filter and sort using a lookup column

I have a table with all my data. I’m trying to simultaneously filter and sort this table in a lookup column of a secondary table. It just doesn’t seem to work.
I’m sharing a dummy doc so you guys can understand this issue better.

Hi, @Breno_Nunes.

Do you need Table 3 to be a separate table (not a view of Table 2) for some reason?

If not, make it a view of the Table 2, not a separate table.

Then you can:

  • hide “Column 2” and “Column 3” if you don’t need them
  • filter the table by “Column 2” to show only fruits
  • sort by “Column 1”

Have a look:

If you do need Table 3 to be a separate table, but need to filter and sort the lookup dropdown values, this Item settings will do it:

Code generated by Coda for the filter is:
[Column 2].Lower() = Lower("fruit")

Hi, Andrei.
Thank you for your help but if you look at my doc I did exactly that and it didn’t work.
You can choose one option only. Either you sort it or you apply a filter. You can’t do both.
It’s really strange. Maybe it’s a Coda bug. Using views is not suitable for my use case.

Indeed. Looks like a bug, please report it through Intercom (Coda support) in the bottom right corner of your doc (the question mark button).

Meanwhile as a workaround you can use a select list with list formula:

[Table 2].Filter([Column 2] = "fruit").Sort(true, [Table 2].[Column 1])

P.S. @Breno_Nunes
For some strange reason, when the filter formula has that .Lower() part in it — it works!!

[Column 2] = "fruit"

doesn’t work (the result is not sorted)

[Column 2].Lower() = Lower("fruit")

works with sorting!

Maybe it has something to do with how Coda differently applies first filter then sort / first sort then filter in this case, IDK. Shouldn’t matter.

Please contact support about this.

1 Like

Thank, you, @Paul_Danyliuk.
As always, you are very helpful. :grinning:

Yes, I saw that you did it and was curios why it didn’t work, so I tried to apply filter and sort with Coda UI, not with custom formula to check if it will work that way.

That’s how I discovered this:

Hi. The difference between the code that was using to filter [Column 2] = “fruit” and Coda’s is only the lower() formula. Unfortunately it doesn’t solve the problem.
It’s definitely a bug.

It does in my copy of your doc, that’s why I posted it:
Screen Shot 2020-10-28 at 9.48.45 PM

(And for me in your original document with Lower() added it works too):


Hi. You are right. Thank you.
I just couldn´t believe the lower() formula could do the trick.
It doesn’t make sense but it does work. :grinning:
Thank you, again