# Virtual Custom Function

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&#x26;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](https://docs.antsomi.com/cdp-365-user-guide-en/data-hub/business-objects/data-objects/groups)
* **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&#x26;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](https://docs.antsomi.com/cdp-365-user-guide-en/annotation/data-format#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](https://docs.antsomi.com/cdp-365-user-guide-en/annotation/data-format#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&#x26;token=64c1df10-1241-4935-9548-92c989c9e413" alt=""><figcaption></figcaption></figure>
