Hide when formula returns always true

945 Views Asked by At

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!

1

There are 1 best solutions below

4
On BEST ANSWER

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.