> For the complete documentation index, see [llms.txt](https://docs.wem.io/platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wem.io/platform/wemtipsandtricks/working-with-data/the-power-of-the-calculated-field.md).

# The Power of the Calculated Field

Tips & tricks: get the most out WEM when using calculated fields and constants

While making applications, you will undoubtedly use constants or pre-defined default settings. Items that have a special meaning and a specific value that does not change. Well… at least not for a while, or not very often. So you might be inclined to just “hardcode” these values whenever applicable.\
But when they do need to be changed, you’ll have a hard time finding all the situations where they are hardcoded in the expressions and labels in your application.

Do you recognize any of the following?

* The email address you want to use as the default sender for all emails in the application.&#x20;
* The VAT-percentage in your financial calculations.&#x20;
* The API-key or token for external applications you use, like Google APIs.&#x20;
* Any pre-defined number or date to be used in some context.

In WEM, you can use a Calculated Field to hold these “constant” values and use this field in your expressions, templates, flows and calculations.\
This way, if the value needs to be changed, there is only one place in WEM where this needs to be done: the expression of the Calculated Field in the Data Model.

![](https://1449034948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_NpOsk0sjotPXNy29Q%2Fuploads%2FobG8cVpeyG48dUdTdonq%2Ftips-calcfieldintree.png?alt=media\&token=49e30c7c-f115-4c6f-995b-8597a3f586e6)

![](https://1449034948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_NpOsk0sjotPXNy29Q%2Fuploads%2FI3NDhoOI3NKRtckc1itr%2Ftips-calcfield.png?alt=media\&token=05eda3a3-f28b-405d-bc2f-87af1f22c03f)

A Calculated Field can be any of the available WEM-Types (Text, Number, Date, Boolean, Single/Multi-select and even a File or Referenced list item).

![](https://1449034948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_NpOsk0sjotPXNy29Q%2Fuploads%2FGexugAq5yV1RdgDRcUFE%2Ftips-newcalcfield-fieldtypes.png?alt=media\&token=db8cfaba-ea3f-4a4e-b792-22a029abadcd)

Calculated Fields can be used in the expressions of other calculated fields. This makes way for some powerful stuff, so be smart and don’t go circular…

Advantage 1: you can find all the usages of a Calculated Field throughout your project with one click on `[Find Usages]` in the field's context menu.

Advantage 2: if you know a change is coming in the future, you can put this in the calculation expression. So you can prepare the change in advance and not worry when the time comes to make the changes.

So, whenever you feel the urge to put a seemingly constant value directly into an expression, stop and think whether a Calculated Field might be the better option.

Don’t forget to organize your Calculated Fields cleverly: put them in a logical place within your Data Model and give them names that instantly clarifies their intended purpose.

![](https://1449034948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_NpOsk0sjotPXNy29Q%2Fuploads%2F5bRXcmNAJoUX5BIyF154%2Ftips-calcfield-settingsexample.png?alt=media\&token=945163f3-aa8f-409b-b61c-bfd07243c1bc)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.wem.io/platform/wemtipsandtricks/working-with-data/the-power-of-the-calculated-field.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
