try:
and({ItemProperty:Approved}!=True, {ItemProperty:CompApproval}!="In Process")
your pipes are producing an "or" statement. For rules you have to think in the negative. In your scenario if both of them are true, you want it to hide the panel.
Setting the logic in separate Rules is equivalent to using an "and" statement.
In your formula, if either one of the statement is true, the panel will be hidden. What you want is for them both to be true (hence the and) for the panel to be hidden.
Since you say you are new to rules, here are a few tips:
value a == value b is the same as equals(value a, value b)
value a != value b is the same as not(equals(value a, value b))
the and & or functions only allow evalutating two items such as and(value a!= "", value a!="value b") - to extend you must nest like and(and(value a!= "", value a!="value b"), value c!="")
And finally, for some rules you have a choice between "Item Properties" and "Named Controls". If you want the panels to show or hide dynamically while the user is in the form filling it out based upon selections (very valuable for "guiding" the user), use Named Controls. If you want the panel to be show or hidden and not change during the form edit based upon user changes, then use Item Properties which is referring to the values stored on the list item at time of form load.
Rules should always allow Named Controls, but other control settings due not.
Thanks for the reply and info. So my panel needs to show in both stages of the approval process. So if it is "in process" or if it has been approved. If I make it an "and" statement it wouldnt show at the correct phases cause both statements would not be true. That is why I was going with the "or" statement.
I believe you are still thinking in the positive.
The rule:
and({ItemProperty:Approved}!=True, {ItemProperty:CompApproval}!="In Process") then Hide
responds to these scenarios:
Approved = True regardless of value of CompApproval; resolves to False, panel is shown
CompApproval = In Progress regardless of value of Approved; resolves to False, panel is shown
Approved != True AND CompApproval != In Process; resolves to True, panel is hidden
so the "positive" description of the rule above would be:
if approved is True or CompApproval is In Progress, show the panel
This did work and much appreciated. I was thinking if I did an "and" statement both would have to be true.
Thanks.
That is correct, both parts need to resolve to true in order to Hide the panel.
The hardest thing when I started with rules, and sometimes I still struggle with, is the use of "and" vs "or" does not feel intuitive.