# Custom Function

## Create New Custom Function

**Step 1:** On Create/ Edit Customer Journey screen, click on icon **Personalization** and select **Add Personalization**.

**Step 2:** On **Add Personalization** pop up, click on **Personalization type** dropdown, select **Custom**.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeuJhEN0RqRh3RC8qs9C2GnLAh7y5vxndeBUeg-xsx-13UC127wq8eI5rFqvDLe1VcgQkUCXHNjjfHZ_SmNwnj-dquyWuXsn5lE0EYEWFMMZCrA2OTHyPyYRImkonP2XGE53Q3K6lE8OHmxWYNaXGg3BNhZ?key=McWN_Lv9ZK-QuQzVrY3nVw" alt=""><figcaption></figcaption></figure>

**Step 3:** Enter custom function name in **Personalization Name** field. You can also click on Personalization Name field and select previously created custom functions from the suggestion list

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdYartMlJvtqQ_aDyf5J6Ts1AKM_xi8g7--Cu8fB5o5BrOw63IaheqTqdvFtQ-t-cuQMWiCH206fI-6o_1otfgy0xR9KFzboVAkeJXzBHDJHO41bjlp4bqSE_mj0KRgiXDvOjptIkDe5ZQYID9FNqU2-NY?key=McWN_Lv9ZK-QuQzVrY3nVw" alt=""><figcaption></figcaption></figure>

**Step 4:** Insert you function you want into **Function** field.

***Note:** Only support **JSON** function.*

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfUAMbjeC08OK8kupi4oIC7N0zoOerFeaDZcBS48B9vtFbB8kK8jvjcwl2N7mllAfZSRqqyj-BmI0M1etVJzURSVHx6kWCq1SU2W1I8sTUi4zbxRSDbTIiM9DnnbqqJV5DX1BlKA94_CKNpnyj4Ic0n91U0?key=McWN_Lv9ZK-QuQzVrY3nVw" alt=""><figcaption></figcaption></figure>

**Step 5:** Choose the appropriate data type and display style for your function in the Out put Data Type field and Output Format

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe3ok5E_l8TWHpxJFpsh5avJky5BmQ9eKpZckL2ykXlghZ3jvtw50lIq7PvEgbNe2k7z-tx_R59AMU45m0vBzMgD0mzPixPGYfIN1Z6j8o9Yv1G6oraIIeSuyoHUXtVAXE0kGw9fAx6u8S6ws42fUP9-EVR?key=McWN_Lv9ZK-QuQzVrY3nVw" alt=""><figcaption></figcaption></figure>

**Step 6:** Optional, if you want to reuse this function, you can save as this function become a template by check on **Save as template** checkbox.

***Note:** After saving as a template, your function will display in the list of suggestions when clicked and enter the function name in the **Personalization name** field.*

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdI-zfOcSh9iGsILQ2W5As5ghbYpDzgUoTNIK66VPSr-k0AI6F2csKOJNz2Fj6j1lsUHm-_m7fregJ__4PRZha1sjt1anIuAr_nqLFpFGge8gUiTCtrbibjC8PI08AAKtWj0v1V5LD1DYEVBAvlT_FsVujV?key=McWN_Lv9ZK-QuQzVrY3nVw" alt=""><figcaption></figcaption></figure>

**Step 7:** Click **Insert** to add your function into Content. After click, your function will display as tag

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdOKXmo8IM0pg1yX1Szcnll-k8LdeXjJd5_4UZsgulHyGQO2m1Uci_WBtNTRZQDStGAixAU68qZ4N1FF263TE9W1-yMRlkPIXhhiDA7Ti7UaTCHjaIsobjlwHSwpWhiZTGqDFdCY8K3bxQoCNfpBtvAPnCa?key=McWN_Lv9ZK-QuQzVrY3nVw" alt=""><figcaption></figcaption></figure>

## Edit Custom Function

If you want to edit your function, you can click on **function's tag**. Add Personalization pop up will display and you can edit your function. After editing, click **Update** to update the edited content.&#x20;

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdMjEoy3he2Y9H4lYffvoCQBf6-3dnBwnkuWHrdrvXuOP0YSES6hj_VFtA53p758W8FUvf5vVWOeOBG6wbmWjcGsJPTfv9xHJxSQOeWLAhmwc4Ef30_QqamWxPnTZIyATevnT2j5ZjxOljbV-aUGBOWGpx6?key=McWN_Lv9ZK-QuQzVrY3nVw" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://docs.antsomi.com/cdp-365-user-guide-en/marketing-hub/customer-journeys/custom-function.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
