I’m facing an issue due to the evaluation of both parts of an AND operator.
But maybe there is a solution I can’t find…
In my application, I need to hide a Table1 content if a user is not in a Table2.
If the user is in this Table2, then I need to filter Table1 with a column “content” of Table2.
(Maybe one day we will have a real user rights management in Coda that ends these inefficient workarounds…)
I do this with :
- a named formula CurrentFilter : Table2.filter(user=user())
- a filter in Table1 : user().in(Table2.User) and (table1.contains(CurrentFilter.content))
If user is in Table2, everything is ok but if he isn’t then there is an error in the filter because CurrentFilter is “empty” and so Content column does not exists.
I didn’t find any solution to solve the error : testing CurrentFilter.IsBlank() does not work neither user().in(Table2.User) because Coda evaluates the both parts of the AND.
Why does CODA do that ??
In every coding languages I know, the B part of an “A AND B” is never evaluated if A is False, because it allows that kind of things and it increases speed of execution !!
Thanks for your help