How To

Using Logical Functions in Business Rules

Logical Functions allow Business Rules to choose which value to use in a field based on some decision criteria. View the table below for Logical Functions supported for Business Rules.

 

Prerequisites


You should be familiar with the following topics:

 

Logical Functions Supported for Business Rules


View the table below for Logical Functions supported for Business Rules.

Function Description Example Output
IF Returns one value if a specified true/false condition is true, and another if it is false. This is a good alternative to SELECTCASE if there is only one condition to check. It works like the “if-else” statement in many programming languages.IF($shippingprice > 0, $shippingprice, 5.00)Shipping value or 5.00 It sets a flat shipping rate of $5 for items with a zero shipping cost.
IF(($ITEMBINPRICE > $ITEMSELLERCOST), $ITEMSELLERCOST, $ITEMBINPRICE)If Buy It Now Price is greater than the Seller Cost, use the Seller Cost. Otherwise use the Buy It Now Price.
IF(CONTAINS($COLOR, "Red"), "Red", $COLOR)Send Red if the Color is Red, otherwise send the value in the Color attribute.
IFBLANK Takes 2 to 8 inputs, and returns the first one that is not blank. This is useful when the desired result is to guarantee a non-blank value.IFBLANK($ITEMUPC, $ITEMMPN, $ITEMEAN)Use UPC, if blank use MPN, if both UPC and MPN are blank, use EAN.
IFBLANK(LOOKUP("Brands", $ITEMBRAND), "N/A")If a Brand is in a Lookup List called Brands, send the corresponding Brand
value. If not send the text "N/A".
ISBLANK Returns false if an input value is NOT blank, and true if an input test IS blank. Not to be confused with IFBLANK. This is useful as the condition part in an IF function.IF(ISBLANK(“Cat”),"Not blank","Blank")"Not blank," because "Cat" is not blank.
ISNUMERIC Whether a text string can be evaluated as a numeric value.ISNUMERIC (“9.95”) ISNUMERIC (“See Site”)true false
ISZERO Whether a text string can be evaluated to zero. If the text cannot be converted to a number, false is returned.ISZERO (“See site”) ISZERO(“0.00”)false true
NOT Returns false if an input test is true, and true if an input test is false. This is a convenience function to make rules more readable - many times the same result can be accomplished by just inverting the original test.NOT(ISUNMERIC(“Cat”)True because cat is not numeric.
SELECTCASE Evaluates up to 5 true/false conditions and returns the corresponding value for the first condition that is true, or a specified default value. The minimum number of arguments to this function is 3: one condition, one value, and a default. Conditions must evaluate to true or false – if one of the conditions evaluates to a string or number instead, an error will occur. The most likely causes of errors with this function are passing the wrong number of arguments or forgetting to pass a default value at the end. Consider using IF if there is only one condition to evaluate.SELECTCASE($countryoforigin = "USA", "Made in the USA", $countryoforigin
= "", "Made in the USA or imported", "Imported")
If the Country of Origin is USA, send "Made in the USA". If it is blank, send "Made in the
USA or Imported". If it is any other value, send the text "Imported".

Logical Functions allow Business Rules to choose which value to use in a field based on some decision criteria. View the table below for Logical Functions supported for Business Rules.

 

Prerequisites


You should be familiar with the following topics:

 

Logical Functions Supported for Business Rules


View the table below for Logical Functions supported for Business Rules.

Function Description Example Output
IF Returns one value if a specified true/false condition is true, and another if it is false. This is a good alternative to SELECTCASE if there is only one condition to check. It works like the “if-else” statement in many programming languages.IF($shippingprice > 0, $shippingprice, 5.00)Shipping value or 5.00 It sets a flat shipping rate of $5 for items with a zero shipping cost.
IF(($ITEMBINPRICE > $ITEMSELLERCOST), $ITEMSELLERCOST, $ITEMBINPRICE)If Buy It Now Price is greater than the Seller Cost, use the Seller Cost. Otherwise use the Buy It Now Price.
IF(CONTAINS($COLOR, "Red"), "Red", $COLOR)Send Red if the Color is Red, otherwise send the value in the Color attribute.
IFBLANK Takes 2 to 8 inputs, and returns the first one that is not blank. This is useful when the desired result is to guarantee a non-blank value.IFBLANK($ITEMUPC, $ITEMMPN, $ITEMEAN)Use UPC, if blank use MPN, if both UPC and MPN are blank, use EAN.
IFBLANK(LOOKUP("Brands", $ITEMBRAND), "N/A")If a Brand is in a Lookup List called Brands, send the corresponding Brand
value. If not send the text "N/A".
ISBLANK Returns false if an input value is NOT blank, and true if an input test IS blank. Not to be confused with IFBLANK. This is useful as the condition part in an IF function.IF(ISBLANK(“Cat”),"Not blank","Blank")"Not blank," because "Cat" is not blank.
ISNUMERIC Whether a text string can be evaluated as a numeric value.ISNUMERIC (“9.95”) ISNUMERIC (“See Site”)true false
ISZERO Whether a text string can be evaluated to zero. If the text cannot be converted to a number, false is returned.ISZERO (“See site”) ISZERO(“0.00”)false true
NOT Returns false if an input test is true, and true if an input test is false. This is a convenience function to make rules more readable - many times the same result can be accomplished by just inverting the original test.NOT(ISUNMERIC(“Cat”)True because cat is not numeric.
SELECTCASE Evaluates up to 5 true/false conditions and returns the corresponding value for the first condition that is true, or a specified default value. The minimum number of arguments to this function is 3: one condition, one value, and a default. Conditions must evaluate to true or false – if one of the conditions evaluates to a string or number instead, an error will occur. The most likely causes of errors with this function are passing the wrong number of arguments or forgetting to pass a default value at the end. Consider using IF if there is only one condition to evaluate.SELECTCASE($countryoforigin = "USA", "Made in the USA", $countryoforigin
= "", "Made in the USA or imported", "Imported")
If the Country of Origin is USA, send "Made in the USA". If it is blank, send "Made in the
USA or Imported". If it is any other value, send the text "Imported".
0
Your rating: None
0
Your rating: None