A table lookup is an excellent way to pull a value from a data table into a rule or calculation. They can be used with data stored in your rule application (Inline Table) or in a database table. Inline Tables work particularly well for relatively small tables (e.g. under 500 rows). If the table is large (e.g. a customer table) it would be better to use a SQL query.
As an example maybe a rule author is writing some rules to calculate shipping for an order and wants to see if a customer’s loyalty status qualifies the order for free shipping. The author might have a table that looks like this:
Based on a customer’s status they want to get the FreeShipping value on the right. An easy way to do that is to return that value to a TRUE/FALSE (Boolean) calculation called Free Shipping.
Example of a table lookup in Business Language:
Example of a table lookup in Syntax:
Even though this example uses a calculation you can evaluate the result of a table lookup in a rule expression or action.
Note: Table lookups require a database table (along with a connection to a database ) or inline table to be setup in the rule application.
Please sign in to leave a comment.