-
Notifications
You must be signed in to change notification settings - Fork 1
And Operator
Martin Danielsson edited this page Jul 23, 2015
·
4 revisions
And operator. Returns true
if both parameters return true.
What | Type |
---|---|
Syntax | And(x, y) |
x |
bool |
y |
bool |
Return type | bool |
The And
operator first evaluates the first parameter. Only if the first parameter evaluates to true
, the second parameter is evaluated.
Example: And(Contains($title, "Lord"), Contains($author, "Tolkien"))
The fact that the evaluation is done parameter by parameter also opens up to using the following kinds of expressions (which are especially useful in filter definitions):
<SourceFilter>And(HasKey("MyLookup", $ID), MyLookup($ID, $Value) = "yes")</SourceFilter>
In this example, the first And
argument checks that the field ID
is actually in the lookup map. If it is, evaluating the second argument is safe.