Using Variables in Computation Rules
Usually when creating computation rules, the goal is to create a useful computation based off of the values of a given loan. These values often change, and we don’t really want to update the computation rule each time a value changes. Also, we want the same rule to apply to multiple loans simultaneously. To achieve this, LoanPro has built-in variables which will be automatically replaced with the latest values for a given loan each time the rule is evaluated. This article will go over variables and how to use them in a Computation Rule.
Note: While it is possible to use a computed value in a computation rule, it is highly discouraged. Using computation fields inside of other computation fields will significantly increase the time it takes to pull custom queries, generate forms and several other system tasks that use the nested computation field.
Adding a Variable a Rule
We will start off by either creating a new computation field or editing an existing one, but this can be done anywhere where a computation can be entered. We will mainly be looking at the Formula editor, but we will choose “Initial Setup” as the Display value. Your page should look like Fig 1.
Fig 1: Formula Editor Page
Start by entering “(+ 200 ” into the text box. We will be finishing the rest of the formula shortly but for now, just put that in there and nothing else. (Please note that there is a space after the 200, that space is required for this to work properly)
What we’ll be using to get variables is the bottom-most section of the formula editor, which is shown in Fig 2. This section allows us to look for different variables that are built-in to LoanPro and to easily add them to our current formula.
Fig 2: Variable Locator
Start by typing “loan amount” in the search box. There should be a result that says “Total Loan Amount”. Click that and the Info section will change to show information about that variable.
The Info section will show the ID of the variable, which is how LoanPro identifies which variable you want. The Formula ID shows how to use it in a rule; this is important since sometimes some variables work differently than others. It will show the Name of the variable which is how it shows up in the search. And finally, it shows the Format of the variable which describes what kind of information is stored in the variable. For the “Total Loan Amount” variable the format is currency, which means that it represents an amount of money.
The value of the ID field should be blue; this means that the ID value is click-able. Go ahead and click on the text and it will add the variable to the formula. Your formula should now look like the this:
( + 200 setup-loan-amount
Now, go ahead and add a closing parenthesis to the formula and click SAVE. Next, open up a loan and go to the Initial Setup tab. Your computation field should be there and It should be the loan amount plus 200.
Congratulations! You used your first variable in a Computation Rule!