> For the complete documentation index, see [llms.txt](https://docs.antsomi.com/cdp-365-user-guide-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.antsomi.com/cdp-365-user-guide-en/data-hub/business-objects/data-objects/attributes/computed-attribute/virtual-custom-function.md).

# Virtual Custom Function

Use formulas for advanced calculations based on computed attributes

The Virtual Custom Function attribute computes only when there is a request from the user (Data Object Data-table, Segment, Journey, AM...)

## Virtual Custom Function Configure

<figure><img src="https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2FUMYgcdusdWwwOBDkpnls%2Fimage.png?alt=media&amp;token=bcbf7ba1-f1bd-490d-8e38-d495caf6edf4" alt=""><figcaption></figcaption></figure>

### General Information

* **Object:** the corresponding Object that you chose to create the attribute
* **Group attribute:** Group contains attributes that have the same characteristic or usage. [See more about Groups](/cdp-365-user-guide-en/data-hub/business-objects/data-objects/groups.md)
* **Attribute type:** [type of attribute](#kieu-thuoc-tinh) you chose to create
* **Attribute name:** name of the attribute
* **Attribute internal code:** code of the attribute
* **Description:** information describes the attribute

{% hint style="warning" %}
Note: the attribute code does not allow prefixes: number\_, sgmt\_, aud\_&#x20;
{% endhint %}

<figure><img src="https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2FdJ5VeSoydA9tPiEWpGiS%2Fimage.png?alt=media&amp;token=8a8bba7c-0216-4f65-9357-7aa3198c1f59" alt=""><figcaption></figcaption></figure>

### Edit Info

* **Function**: You can enter functions or drag the suggested on the right of the Function list or Available Attributes
  * **Function list:** includes Operators, string, Math, Calendar/Date, Expression
  * **Available Attributes:** contains a list of available attributes that the user can use in Function
* **Data type of function output:** the data type of function output such as Number, String, Datetime. See more about [Data Type](/cdp-365-user-guide-en/annotation/data-format.md#data-type)
* **Display function output**: display format for the output of the function, it depends on the data type of function output.  See more about [Display Format](/cdp-365-user-guide-en/annotation/data-format.md#display-format)
* **Attribute usage setting:**&#x20;
  * **Enable Data Encryption:** mark data encoding for this attribute

{% hint style="info" %}
CDP 365 supports different functions corresponding with each data type
{% endhint %}

<figure><img src="https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2FnlIfQdW8oo9v9rIWJlCI%2Fimage.png?alt=media&amp;token=64c1df10-1241-4935-9548-92c989c9e413" alt=""><figcaption></figcaption></figure>


---

# 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.antsomi.com/cdp-365-user-guide-en/data-hub/business-objects/data-objects/attributes/computed-attribute/virtual-custom-function.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.
