Skip to main content
All CollectionsLender Expression Engine
Working with Logical Functions in the Lender Expression Engine
Working with Logical Functions in the Lender Expression Engine
Updated over 5 months ago

Introduction:

The Lender Expression Engine provides a robust set of logical functions that enable users to perform standard boolean operations. These functions accept boolean expressions as parameters and are essential for creating complex logical statements and workflows. This article outlines the key logical functions available in the engine, along with examples to illustrate their usage.

Logical Functions:

1. AND(exp1, exp2, ...):

  • Description: Returns true if all expressions are true.

  • Example: AND(1 == 1, 2 != 3)

    • This example checks if both conditions (1 equals 1 and 2 not equals 3) are true.

2. OR(exp1, exp2, ...):

  • Description: Returns true if at least one of the expressions is true.

  • Example: OR(2 == 3, 1 == 1)

    • This example checks if either condition (2 equals 3 or 1 equals 1) is true.

3. NOT(exp):

  • Description: Returns the opposite of the given expression.

  • Example: NOT(1 == 2)

    • This example checks if 1 does not equal 2.

4. EMPTY(value):

  • Description: Returns true if the value is null or default (empty).

  • Example: EMPTY(0)

    • This example checks if the value is 0 (empty for numerical values).

5. EMPTY(value) with different data types:

  • Description: Checks if various data types are empty.

  • Examples:

    • Numeric: EMPTY(0) - checks if the value is zero.

    • GUID: EMPTY('00000000-0000-0000-0000-000000000000') - checks if the value is the default GUID.

    • Boolean: EMPTY(false) - checks if the value is false.

Examples of Logical Function Usage:

Example 1: Combining Multiple Conditions with AND

AND( Program.Assumable == true, Program.InterestOnly == false, Loan.LoanAmount > 100000 )

This example checks if a loan program is assumable, not interest-only, and the loan amount is greater than $100,000.

Example 2: Using OR for Alternative Conditions

OR( Borrower.MaritalStatus == 'Married', Borrower.MaritalStatus == 'Separated' )

This example checks if the borrower's marital status is either 'Married' or 'Separated'.

Example 3: Negating a Condition with NOT

NOT(Borrower.CreditScore < 600)

This example checks if the borrower's credit score is not less than 600.

Example 4: Checking for Empty Values

EMPTY(Borrower.MiddleName)

This example checks if the borrower's middle name is empty (null or an empty string).

Example 5: Combining Logical Functions

AND( ANY(Application.Borrowers, EMPTY(_borrower.SpousePerson)), NOT(Loan.LoanAmount < 200000) )

This example checks if any borrower does not have a spouse listed and if the loan amount is not less than $200,000.

Conclusion:

The Lender Expression Engine's logical functions provide essential tools for creating complex logical expressions. By using functions like AND, OR, NOT, and EMPTY, users can build sophisticated workflows and ensure that their conditions and checks are accurately evaluated.

Did this answer your question?