Bug With Autogenerated Lookup Value Filter When Lookup References Self

When setting a custom item settings filter in a lookup column, the formula that’s generated is incorrect.

This thinks its formula should be:
thisRow.[Source Doc].Lower() = Lower("Ops")

And that seems like it should work, but all the cells offer only Blanks as lookup options.
image

Retyping the formula manually as:
[Source Doc].Lower() = Lower("Ops")

(note that the thisRow part is removed).

Causes it to work. I’m not totally sure why this is the case, but I’m pretty sure this is a bug.

Ready for @Federico_Stefanato ot tell me otherwise.

Hi @cnr

:smile:
I tried to reproduce your use case, but the formula generated is without thisRow, though.

If this is what you get, I think you’re right.
Could you share it just to see how to reproduce it?

Hi @cnr and @Federico_Stefanato, i often end up using “table.filter(conditions)” directly in the formula of the column, or in select list column, depending on the needs, i think that i haven’t used a lookup column in a long! Why this approach couldn’t work? :slight_smile:
Also, could it be that filters in lookup column use “currentvalue” and not thisrow approach?

Can’t share the doc unfortunately, I can take a screencapture.

upload error

For whatever reason, this gif won’t display. Nevermind, there is a max height of 500 on uploads. Once I got it small enough it worked.

It seems that maybe I’m wrong, it is no longer showing me thisRow, but it is still failing (and it could just be that the thisRow is implicit, sometimes it does get hidden) I can confirm that prepending thisRow at least replicates the error.

@cnr Sorry but it works, and it refers to currentvalue

Screenshot 2020-11-21 at 22.31.46

That’s the formula i get using the same steps of your video (the one coda created seen as formula)

You did the one for “contains” not “is equal to”

Also, make sure that the column Table is a lookup for the table Table

Sorry, you’re right! :sweat_smile:
But, sadly it works…
This is the autogenerated formula…
Screenshot 2020-11-21 at 22.37.54

Can you share your doc?

Yes sure!
Wait just a sec that i check if it behave in the same way “lookupping” the same table!

UPDATE: no ok totally unpredicted behaviour, let me explore deeper :joy:

Definitive update: You are right @cnr, when you create a lookup column that refers to the same table, the default formula created using “is equal to” lead to a strange behaviour that in my test created a complete list of the rows of the table where the “Source doc” (or whatever) is equal to Ops, or other text, and a blank list in every other

Obv there are workaround to solve the problem, but your idea of this being more a bug is supportable!
@coda_team

Sorry for having to try 4 times :joy:

1 Like

Glad it happened for you too, I was starting to feel insane

Nono you’ve found something!

Also, it happens with any type of “coda generated filter”, also using interactive one, and that happen because the formula, if is referring to his own table, turn currentvalue.columnname into thisrow.columnname, that part is wrong the rest works! :smiley:

Obv, changing the formula to currentvalue make things works fine again :slight_smile:

Screenshot 2020-11-21 at 23.06.20