If I use this formula:
@DbLookup( “” : “NoCache” ; “” : “” ; “UserProfile”;User ; 2 )
In a field it works fine and returns exactly what I expect it to. But when I use it in the ‘Hide When’ tab of a field or in my case some text, I use:
Hide paragraph if formula is true
@if(@DbLookup( “” : “NoCache” ; “” : “” ; “UserProfile”;User ; 2 ) != 000283)
It does not seem to work out.
I’m thinking that it should be reading the documents in the view, and finding a match thereby making that formula true (there are more than just that one document in the view)
What is it that I am missing, or not understanding about the hide when process?
By the way, in my testing, there are 2 documents in the 2nd column of the “User” view, I’d like to use both, but had no luck there either.
Subject: Lose the IF
A hide-when formula needs to evaluate to True or False. You don’t need to use an If statement.
@DbLookup( “” : “NoCache” ; “” : “” ; “UserProfile”;User ; 2 ) != 000283
should work if the value truly is numeric. If it’s a string, you may need quotes around the 000283 value.
Subject: Also…
How to Write a Hide Formula and Performance basics for developers (whitepaper) (with reference to your misuse of NoCache option)
Subject: That did the tirck
Just that simple… that did the trick.
Thanks a bunch
A a bonus, and I don’t think I ‘need’ this, but is there an “and” or an “or” that can be used. Such as
@DbLookup( “” : “NoCache” ; “” : “” ; “UserProfile”;User ; 2 ) != 000283 ‘and’ 001283
( “” : “NoCache” ; “” : “” ; “UserProfile”;User ; 2 ) != 000283 ‘or’ 003465
Subject: Sure …
I prefer to wrap my Hide-When’s with a NOT operator, so they become Show-When’s.Note that you could put all three lines in one, but I find this easier to read.
!(
@DbLookup( “” : “NoCache” ; “” : “” ; “UserProfile”;User ; 2 ) = 000283:001283
)