> For the complete documentation index, see [llms.txt](https://docs.violetlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.violetlabs.com/features/reports/multisource/custom-columns.md).

# Custom columns

Custom columns can be used to add information to a report beyond what is natively generated from the sources in Violet. When you save a report, any custom columns will be saved along with it.

Add custom columns to a multisource report by clicking on <mark style="color:purple;">**+ COLUMN**</mark>.

<figure><img src="/files/K35Zh0fdYF3kMBiPHvCQ" alt="" width="563"><figcaption></figcaption></figure>

Custom columns can be of the type:&#x20;

* &#x20;`Text`
* &#x20;`Number`
* &#x20;`User`
* &#x20;`Custom Formula`

<figure><img src="/files/egZhFW9JvG1Qz3lUM01V" alt="" width="341"><figcaption></figcaption></figure>

### Static data

Choosing `Text`, `Number`, or `User` will create a column where you can populate each cell individually by clicking on the cell. The values in these cells must be updated manually, and do not depend on the information in the rest of the report.

If  `User` is selected, double-clicking on a cell will reveal a dropdown selector where you can choose any of the users in your Violet environment.

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

### Custom formulas&#x20;

In addition to adding columns with static values, you can also add columns that relate to existing information in the table based on formulas that you define. This lets you generate important information about parts or POs directly in the report. These columns will update along with the information in the rest of the report table whenever it is opened.

To use this functionality, select the `Custom Formula` Column Type and enter your formula. When building your formula, type an opening bracket (`[`) to show a searchable list of columns and elements that you can reference in your formula.

{% embed url="<https://www.loom.com/share/6b8f419953bc498a944073f5590e3159>" %}

Custom formulas leverage **math.js** syntax and operators. You can find the full documentation of this syntax here: [math.js documentation](https://mathjs.org/docs/expressions/syntax.html).

### Custom formula examples

Consider the use case where you'd like to calculate whether you have enough parts in inventory to build an assembly. The following examples describe three different methods to create and display such an "Inventory Shortage" column.

The first example uses simple subtraction to show the numeric shortage value for each part. The second example adds a conditional expression to indicate whether or not there is a shortage in a more readable format. The third example combines basic math, a conditional expression, and string manipulation into a multi-line function that outputs a readable shortage indicator with the numeric shortage value.

#### Basic Math

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

#### Conditional expressions

<figure><img src="/files/2bEGXXMQ58SICmZ0j3bA" alt="" width="563"><figcaption></figcaption></figure>

#### Multi-Line Functions

<figure><img src="/files/sdBmM3BJ3qAkfQ5Aefak" alt="" width="563"><figcaption></figcaption></figure>

*Note:* *This use case is common enough that we developed a Clear To Build report to show this type of information, with some additional functionality. See details on that* [*here*](/features/reports/clear-to-build.md)*.*


---

# 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.violetlabs.com/features/reports/multisource/custom-columns.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.
