CMS
Computed expressions
Logical
14min
and returns true if all of the provided arguments are logically true, and false if any of the provided arguments are logically false syntax and(logical expression1, \[logical expression2, ]) logical expression1 an expression or field containing a value that represents some logical value, i e true or false, or an expression that can be coerced to a logical value logical expression2, \[ optional ] additional expressions or fields containing values representing some logical values, i e true or false, or expressions that can be coerced to logical values sample usage and(firstname = "foo", lastname = "bar") and(true, false, true) notes the number 0 is logically false; all other numbers (including negative numbers) are logically true false returns the logical value false syntax false() sample usage false() if returns one value if a logical expression is true and another if it is false syntax if(logical expression, value if true, value if false) logical expression an expression or field containing an value that represents some logical value, i e true or false value if true the value the function returns if logical expression is true value if false the value the function returns if logical expression is false sample usage if(name = "foo", "name is foo", "name is not foo") if(property, "property was true", "property was false") if(true, 4, 5) notes ensure that value if true and value if false are provided to the function, and in the correct order ifs evaluates multiple conditions and returns a value that corresponds to the first true condition syntax ifs(logical expression, value if true, logical expression2, value if true2) logical expression the first condition to be evaluated this can be a boolean, a number, an array, or a reference to any of those value if true the returned value if logical expression is true logical expression2, value if true2, … additional conditions and values if the first one is evaluated to be false sample usage ifs(name = "foo", "name is foo", name = "bar", "name is bar") ifs(true, 4) notes if all conditions are false, #n/a error is returned coalesce the coalesce function evaluates its arguments in order and returns the first value that isn't undefined syntax coalesce(value1, \[value2, ]) value1 the first value to evaluate and return if it is not undefined value2, \[optional] additional values to continue evaluating and potentially return if value1 is undefined sample usage coalesce(property1, property2) returns property2 if property1 is undefined, otherwise it returns property1 coalesce(ans(), today()) keeps the creation date regardless of how many times the value gets recomputed not returns the opposite of a logical value not(true) returns false, not(false) returns true syntax not(logical expression) logical expression an expression or reference to a property holding an expression that represents some logical value, i e true or false sample usage not(property) or the or function returns true if any of the provided arguments are logically true, and false if all of the provided arguments are logically false syntax or(logical expression1, \[logical expression2, ]) logical expression1 an expression or reference to a property containing an expression that represents some logical value, i e true or false, or an expression that can be coerced to a logical value logical expression2, \[ optional ] additional expressions or references to properties containing expressions representing some logical values, i e true or false, or expressions that can be coerced to logical values sample usage or(firstname = "foo", lastname = "bar") or(true, false, true) or(0, 1, 2, 3) notes the number 0 is logically false; all other numbers (including negative numbers) are logically true isblank checks whether the referenced property is empty syntax isblank(value) value reference to the property that will be checked for emptiness isblank returns true if value is empty or a reference to an empty property, and false if it contains data or a reference to data sample usage isblank(property) if(isblank(numericproperty),,5/numericproperty) notes isblank returns false if the referenced property has any content, including spaces, the empty string (""), and hidden characters in case of unexpected false results, try clearing the property again to remove any hidden characters this function is most often used in conjunction with if in conditional statements true returns the logical value true syntax true() sample usage true() switch tests an expression against a list of cases and returns the corresponding value of the first matching case, with an optional default value if nothing else is met syntax switch(expression, case1, value1, \[case2, value2, ], \[default]) expression any valid values case1 the first case to be checked against expression value1 the corresponding value to be returned if case1 matches expression case2, value2, … \[optional] additional cases and values if the first one doesn’t match the expression default \[optional] an optional value, specified as the last parameter, to be returned if none of the cases match the expression sample usage switch(property, 0, “no”, 1, “other”) switch(property, 4, “four”, 8, “eight”)