Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide when formula returns always true

I have a view called "vwTest" which has one column and lists 3 docs:

John Mcoy
Peter Pap
Ashley Young

I have a picture with a default hotspot on which I typed the following Hide when formula:

view := "vwTest";
nume := @Name([CN];@UserName);
@If(@IsMember(nume;_view);@False;@True)

The user is John Mcoy. But the picture is hidden. Why? Thanks!

like image 633
Florin M. Avatar asked Mar 02 '26 14:03

Florin M.


1 Answers

You have to check if your user is in first (sorted) column of your view. You can do that with @DbLookup. Your hide formula would look like this:

@DbLookup("":"NoCache"; ""; "vwTest"; @Name([CN];@UserName); 1; [FAILSILENT]) = ""

It returns @True if the username is not in view's first column.

[FAILSILENT] let @DbLookup return an empty string if the key username is not found in column.

In your question's code you just test if username is member of string "vwTest" which of course is never the case.

like image 127
Knut Herrmann Avatar answered Mar 05 '26 10:03

Knut Herrmann