# Maths Field

Our Maths Field gives you the ability to write basic equations using the values of fields in that bloc. For example, if Field A has the value 13 and Field B has the value 40, then to add those and have the result shown in the maths field, the maths field equation will look like the following field\_a + field\_b. It is useful for working with counts of totals, or other uses like creating invoices.

{% hint style="info" %}
**Note:** The result of the equation is updated every time the [Rules/Actions](/blocworx-documentation/bloc-editor/managing-a-field/field-rules.md) are triggered for a field that is inside the equation. For Example, if Field A and Field B are in the equation, when the rules are triggered for Field A the maths field will attempt to update.\
\
For this reason, if Field A or B are text fields you must press enter or tab for the maths field to take effect. To get around this you can apply the [Trigger rules on Keypress](/blocworx-documentation/bloc-editor/managing-a-field/field-parameters/rule-and-actions-based-parameters.md#trigger-rules-as-soon-as-value-changes-requires-keypress) parameter. This will mean the equation will update as you type.
{% endhint %}

{% hint style="info" %}
Note 2: And understanding of our [Field Slugs](/blocworx-documentation/bloc-editor/bloc-settings/list-of-available-field-slugs.md) is required to use this field. However, you may find it intuitive enough to use by itself by simply clicking "View Field Slugs" and begin clicking the fields you want in the equation.
{% endhint %}

![A slightly more complex example, where we add multiple Field A by Field B, divide this result by 4, and then add the value of Field C. See Below for the output of this on the bloc:](/files/2GbJAGZmDiOxPULK8sjS)

![As per the above equation, 6 \* 5 = 30, 30/4 = 7.5 and finally 7.5 + 4 = 11.5](/files/LLuq5sxFGPVQD0WWeyyc)

It is also possible to use functions for more complex calculations, e.g min, max and avg

<figure><img src="/files/n9jHY4tbpqWzOagGqOSt" alt=""><figcaption><p>An example of how to use min function. In this example the output is the smallest value between field_1, field_2, field_3 plus 20</p></figcaption></figure>

### Initial Parameters

<table data-header-hidden><thead><tr><th></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td>Default Text if Syntax is incorrect</td><td>Provides the user with an error message if the equation syntax is incorrect.</td><td></td></tr><tr><td>Hidden or Empty Field Behaviour</td><td>If enabled, it will default empty or blank values to 0.</td><td></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/dynamic-output-and-variable-components/maths-field.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
