> For the complete documentation index, see [llms.txt](https://docs.agilecase.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.agilecase.com/administrator-documentation/types-of-custom-field/javascript-label.md).

# JavaScript Label

<figure><img src="/files/WCJlCLA09PAhYm7Nu4Ax" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/jhrjjXyVtaZ1F9QgXKHL" alt=""><figcaption></figcaption></figure>

The JavaScript label field type allows you to enter your own javascript commands that function within the tab. The script shown above will calculate the age of a client based on their date of birth.

JavaScript fields can be used in a variety of ways: they can carry out calculations, edit the UI and provide advanced formatting options dependent on the values saved in the fields present in the tab. Unlike on save and on load scripting, JavaScript labels only function in the tab they are present in, so cannot be used when creating documents or reports.

This screenshot shows the field above in the contact tab. The calculation is carried out using the "Date of Birth" field above and the result is displayed in the JavaScript field.

To see what else you can do with JavaScript labels, and how to write the script itself, see [Custom Form Scripting](/developer-documentation/custom-form-scripting.md) in the developer documentation.

If you have any trouble creating your own fields or would like to implement JavaScript labels but lack the technical knowledge to do so, please get in touch at <sales@agilecase.com> for more information and pricing.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.agilecase.com/administrator-documentation/types-of-custom-field/javascript-label.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
