# How to automatically calculate the size of a variant

To make a rule that will calculate the volume of a [variant](/fundamental-concepts/data-management.md) based on the dimensions of that [variant](/fundamental-concepts/data-management.md), make a [trigger](/reference/settings/data-governance/business-rules/business-rule-details/triggers/trigger-details.md) that [triggers](/reference/settings/data-governance/business-rules/business-rule-details/triggers/trigger-details.md) when any of the dimensions change.

<figure><img src="/files/XamHMbj9bG28VF290nNo" alt=""><figcaption><p>Setup trigger</p></figcaption></figure>

Then add an [action](/reference/settings/data-governance/business-rules/business-rule-details/actions/action-details.md) and choose "Calculate value". When configuring the [action](/reference/settings/data-governance/business-rules/business-rule-details/actions/action-details.md) click "Add math calculation" and choose "Add math operation".\
\
In this example we start by multiplying the height and width. That result is then multiplied with the length. Finally that result is multiplied with 0,001 to make sure the units are correct.&#x20;

<figure><img src="/files/vlcEer0LorPe9oUOoIyQ" alt=""><figcaption><p>Configure action</p></figcaption></figure>

Finally choose what [attribute](/fundamental-concepts/workflows-and-automation.md) the result should be written to.

{% hint style="info" %}
**Note** By clicking the operator between the values you can choose the operator (x,/,+,-).
{% endhint %}


---

# 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://docs.struct.com/tutorials/guides/how-to-use-business-rules/how-to-automatically-calculate-the-size-of-a-variant.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.
