How To

Using Lookup Functions in Business Rules

Lookup Functions perform queries using Lookup Lists that you defined in your account.

 

Prerequisites


You should be familiar with the following topics:

 

Lookup Functions Supported for Business Rules


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

Lookup Function Description Example Value
CONTAINSWORDLIST

Examines each word in input text, and will return TRUE if at least one word is in the supplied list.

CONTAINSWORDLIST(“Some List”, $offername)

TRUE if the offername contains a word in the list named "Some List"

ISINLIST

Check to see if a passed text value exists in the specified lookup list. This returns TRUE or FALSE depending on whether the item is found.

To return an associated lookup value, use LOOKUP instead. If the list does not exist, an error will occur and the inventory item will not be processed. List names are not case sensitive, but values are.

For info on an optional third parameter see below .

ISINLIST(“Excluded Items”, $model)

TRUE if inventory item is in the list named "Excluded Items"

LOOKUP

Gets a value from the named lookup list based on the specified key. Returns a blank value if the specified key does not exist. If the specified list does not exist, an error will occur and the inventory item will not be processed. List names are not case sensitive, but keys are.

For info on an optional third parameter see below .

LOOKUP(“Item Color”, $model)

Returns the Color associated with the item from a list named "Item Color"

REPLACEWORDLIST

Examines each word in input text, and will substitute its corresponding lookup value from the supplied list (if it exists).

REPLACEWORDLIST("mylist","Big Box of Stuff")

Huge Box of Things [assumes there is a list called "mylist" that contains the name/value pairs Big/Huge and Stuff/Things]

 

The ISINLIST and LOOKUP rules support a third parameter, which can be one of the following text values:

  • full – This is the default if the third parameter is not specified. This will allow the rule to identify a list entry that exactly matches the third parameter.
  • partial – This will allow the rule to identify a list entry that is contained within the second parameter.
  • reversepartial – This will allow the rule to identify a list entry that contains the second parameter.
  • regex – This will allow the rule to identify a list entry that is a regex pattern that matches the second parameter.
  • reverseregex – This will allow the rule to identify a list entry that matches a regex pattern specified by the second parameter.

Examples:

  • ISINLIST(“MyList”, “Six String”, “full”) will identify MyList key “Six String”.
  • ISINLIST(“MyList”, “This is my Six String guitar”, “partial”) will identify MyList key “Six String”.
  • ISINLIST(“MyList”, “ix Str”, “reversepartial”) will identify MyList key “Six String”.
  • ISINLIST(“MyList”, “This is my bass guitar”, “regex”) will identify MyList key “^.?his”.
  • ISINLIST(“MyList”, “ix..t”, “reverseregex”) will identify MyList key “Six String”.

Lookup Functions perform queries using Lookup Lists that you defined in your account.

 

Prerequisites


You should be familiar with the following topics:

 

Lookup Functions Supported for Business Rules


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

Lookup Function Description Example Value
CONTAINSWORDLIST

Examines each word in input text, and will return TRUE if at least one word is in the supplied list.

CONTAINSWORDLIST(“Some List”, $offername)

TRUE if the offername contains a word in the list named "Some List"

ISINLIST

Check to see if a passed text value exists in the specified lookup list. This returns TRUE or FALSE depending on whether the item is found.

To return an associated lookup value, use LOOKUP instead. If the list does not exist, an error will occur and the inventory item will not be processed. List names are not case sensitive, but values are.

For info on an optional third parameter see below .

ISINLIST(“Excluded Items”, $model)

TRUE if inventory item is in the list named "Excluded Items"

LOOKUP

Gets a value from the named lookup list based on the specified key. Returns a blank value if the specified key does not exist. If the specified list does not exist, an error will occur and the inventory item will not be processed. List names are not case sensitive, but keys are.

For info on an optional third parameter see below .

LOOKUP(“Item Color”, $model)

Returns the Color associated with the item from a list named "Item Color"

REPLACEWORDLIST

Examines each word in input text, and will substitute its corresponding lookup value from the supplied list (if it exists).

REPLACEWORDLIST("mylist","Big Box of Stuff")

Huge Box of Things [assumes there is a list called "mylist" that contains the name/value pairs Big/Huge and Stuff/Things]

 

The ISINLIST and LOOKUP rules support a third parameter, which can be one of the following text values:

  • full – This is the default if the third parameter is not specified. This will allow the rule to identify a list entry that exactly matches the third parameter.
  • partial – This will allow the rule to identify a list entry that is contained within the second parameter.
  • reversepartial – This will allow the rule to identify a list entry that contains the second parameter.
  • regex – This will allow the rule to identify a list entry that is a regex pattern that matches the second parameter.
  • reverseregex – This will allow the rule to identify a list entry that matches a regex pattern specified by the second parameter.

Examples:

  • ISINLIST(“MyList”, “Six String”, “full”) will identify MyList key “Six String”.
  • ISINLIST(“MyList”, “This is my Six String guitar”, “partial”) will identify MyList key “Six String”.
  • ISINLIST(“MyList”, “ix Str”, “reversepartial”) will identify MyList key “Six String”.
  • ISINLIST(“MyList”, “This is my bass guitar”, “regex”) will identify MyList key “^.?his”.
  • ISINLIST(“MyList”, “ix..t”, “reverseregex”) will identify MyList key “Six String”.
0
Your rating: None Average: 1 (1 vote)
0
Your rating: None Average: 1 (1 vote)