Examples—Math methods in rule expressions

For example, you might want to raise a query when the value of an item is a specific distance from a known mean value. You can create constants called Mean and Range for the mean and the range from the mean value. The rule might look like this:

evaluate on Form Submission
value = (Mean + Range) >= item.Value && item.Value >= (Mean – Range)
when value is false
query “Value is out of range”

However, because the difference between the mean value and the range could be positive or negative, you must check the absolute value against the range. In that case, you can use the math method that returns an absolute value. Your rule might look like this:

evaluate on Form Submission
value = Math.Abs(Mean – item.Value) <= Range
when value is false
query “Value is out of range”