Help Center

# How do Calculation fields work?

Calculation fields can be used to write simple expressions to calculate values dynamically based on inputs given to other fields in your forms. This can be simple ‘total’ calculations or complex equations referencing other calculation fields and even data contained in repeatable sections.

As seen in the example video below, when you build an expression using a calculated field, you have access to all of your form field values from within the expression builder tool for driving calculations. There’s an extensive library of searchable functions, most of which you’ll recognize if you’re familiar with building formulas in spreadsheets like Excel or Google Sheets. Also included are several functions that are Fulcrum data-specific, giving you the ability to include in your calculations your record’s status, latitude or longitude, and more.

A few example use cases could be:

• Calculation of dimensions, areas, and volumes for site surveys
• Determining totals for supply and inventory applications
• Weighting and averaging for dynamic scoring
• Displaying summary text with concatenation

## Expressions

You can view our currently available functions on our developer pages.

For users wanting to calculate more complex results from their data, calculated field expressions can be written in Javascript. This means you can write complex functions (and entire programs) to return results out of user-entered data on-the-fly.

Having trouble writing your expression? Maybe some of these tips will help:

### Code Text Field and eval Calculation Field

This is a neat way to test expressions on a mobile device on-the-fly:

2. Add a calculation field to your form. Set the expression for this field to eval(\$code_field_data_name).
3. Sync your mobile device, and now you can type code into the text field. You’ll see the result work in the eval field!

### SHOWERRORS()

If you’re having trouble figuring out what’s going on with your expression, call the SHOWERRORS() method at the top of your calculation, and it will help you determine what the issue is:

It can also be combined with a Code Text Field and eval Calculation Field (previous section) to help troubleshoot on the mobile device:

### INSPECT()

INSPECT() is useful when writing your expression. It will give the value of whatever you pass in: