The Formula Tester is a powerful development tool that allows you to evaluate SchemeServe formulas against a specific case or policy. It enables you to test formulas independently, making it easier to build and troubleshoot rating files, rules, APIs, document templates and email templates.
Rather than making changes to your scheme and repeatedly running quotations, you can validate formulas instantly using real policy data.
Why Use the Formula Tester?
The Formula Tester helps you:
- Validate formula syntax before using it.
- Test system IDs and question references.
- Check returned values from policies or quotes.
- Troubleshoot unexpected results.
- Test calculations without affecting the policy.
- Build confidence before adding formulas to Rating, Rules or APIs.
It is one of the most useful tools available when developing within SchemeServe.
Accessing the Formula Tester
Navigate to the Formula Tester in the bottom right of a policy.
If the case contains multiple records (for example, MTAs or renewals), select the appropriate policy record from the dropdown list.
The Formula Tester evaluates formulas using the data from the selected record.
Tip: Use a representative test case containing realistic data to ensure accurate results.
Understanding the Formula Tester
The Formula Tester consists of several sections.
| Section | Purpose |
|---|---|
| Case ID | The case to evaluate formulas against. |
| Policy Record | Selects which record within the case to use. |
| Formula Box | Enter the formula you wish to test. |
| Sum / Loop | Determines how formulas are evaluated. Sum is used for standard formulas, while Loop evaluates each repeated item individually (for example, MultiPage risks). |
| New Rating / Old Rating | Selects which rating engine to use. In most cases, use New Rating. |
| Executions | Runs the formula multiple times to measure performance. Normally this should remain as 1. |
| Run | Executes the formula and displays the result. |
| Results | Displays the returned value and any errors. |
Testing Your First Formula
To return the policy inception date, enter:
[Policy.InceptionDate]Select Run.
The result will display something similar to:
08/07/2026 00:00:00Formatting Results
Sometimes you'll want to display the returned value differently.
For example, to remove the time from a date:
[Policy.InceptionDate].ToString("dd/MM/yyyy")Result:
08/07/2026Formatting values in the Formula Tester is useful when building APIs, documents or email templates.
Example Formulas
Return Today's Date
Today()Example Result
17/07/2026Add One Year to a Date
[Policy.InceptionDate].AddYears(1)Calculate the Policy Length
([Policy.ExpiryDate]-[Policy.InceptionDate]).DaysSimple IF Statement
IF([Premium]>500,"High Premium","Standard Premium")Round a Number
ROUND([Premium],2)Convert Text to Upper Case
[CustomerSurname].ToUpper()Join Two Values Together
[CustomerFirstName] + " " + [CustomerSurname]Working with System IDs
System IDs allow you to retrieve information already stored within the current policy.
Common examples include:
| System ID | Description |
|---|---|
| [Policy.PolicyId] | Internal Policy ID |
| [Policy.CaseId] | Case ID |
| [Policy.Reference] | Policy reference |
| [Policy.InceptionDate] | Policy start date |
| [Policy.ExpiryDate] | Policy expiry date |
| [Policy.Status] | Policy status |
| [Policy.AgentId] | Agent ID |
| [Policy.ProductId] | Product ID |
| [Policy.SchemeId] | Scheme ID |
| [Policy.CreatedDate] | Date the policy was created |
You can also reference answers from questions within your scheme using their question names.
Note: The available system IDs depend on the context in which the formula is being used.
Sum vs Loop
The Formula Tester provides two evaluation modes.
Sum
This is the default option and should be used for most formulas.
It evaluates the formula once and returns a single result.
Loop
Loop evaluates the formula against each repeated item individually.
This is useful when working with MultiPage data, such as multiple vehicles or properties, where you need to inspect the result for each individual record.
New Rating vs Old Rating
Most schemes should use New Rating.
The Old Rating option is available for legacy schemes that still use the previous rating engine.
Unless advised otherwise, always leave New Rating selected.
Executions
The Executions field determines how many times the formula is evaluated.
For normal testing, leave this as:
1Increasing this value can be useful when performance testing complex formulas.
Understanding the Results
After selecting Run, the Formula Tester displays:
- The value returned by the formula.
- The execution time.
- Any syntax or runtime errors.
For example:
Result:
08/07/2026If the formula cannot be evaluated, an error message will be displayed instead.
Common Errors
Missing Bracket
Formula:
[Policy.InceptionDate].ToString("dd/MM/yyyy"Result:
SyntaxError: Unexpected end of fileCause
A closing bracket or quotation mark is missing.
Correct Formula
[Policy.InceptionDate].ToString("dd/MM/yyyy")Unknown Property
Formula
[Policy.Inception]Result
Unknown propertyCause
The system ID does not exist or has been misspelled.
Invalid Question Name
Formula
[VehicleColour]Result
Question not foundCause
The referenced question does not exist within the selected scheme.
Object Reference Not Set
Formula
[Policy.RenewalDate].ToString("dd/MM/yyyy")Result
Object reference not set to an instance of an object.Cause
The value being formatted is empty (null).
Type Mismatch
Formula
[Premium] + "ABC"Result
Cannot convert String to DecimalCause
A number is being combined with text without converting the data type.
Unknown Function
Formula
DATEFORMAT([Policy.InceptionDate])Result
Unknown function 'DATEFORMAT'Cause
The function is not supported by the SchemeServe formula language.
Troubleshooting Tips
If your formula doesn't return the expected result:
- Check the spelling of system IDs and question names.
- Ensure all opening brackets have matching closing brackets.
- Verify all quotation marks are closed.
- Confirm the selected case contains the required data.
- Test individual parts of complex formulas before combining them.
- Check that values exist before applying methods such as .ToString().
- Use the Formula Tester to validate each formula before adding it to a Rating file, Rule or API.
Best Practices
- Test formulas before using them elsewhere in SchemeServe.
- Use representative test cases containing realistic data.
- Start with simple formulas before building more complex expressions.
- Build complex formulas incrementally to make troubleshooting easier.
- Use meaningful question names to simplify formula writing.
- Validate dynamic values before inserting them into API requests.
- Re-test formulas whenever related questions or business logic change.

