---
title: Apply any function (SQL) Custom Value
slug: segment/apply-any-function-sql-custom-value
docTags: 
createdAt: 2026-01-15T19:57:55.214Z
---

:::hint{type="info"}
This feature is available on **Unaric Segment Advanced**.
:::

Apply any function (SQL) Custom Value allows you to write a query needed for your Selection using any of the SFMC-supported SQL operators. You can use the board freely to either code from scratch or copy-paste existing queries applied in the *SELECT* clause to generate new values as necessary.

:::hint{type="warning"}
Only SQL functions applied in the *SELECT* clause work. Queries with a *FROM/WHERE* statement or that require other statements after the *SELECT* clause (e.g. a *GROUP BY*) won't work.
:::

## Video overview

::embed[]{url="https://vimeo.com/681368513?fl=pl&fe=vl"}

## Create an Apply any function (SQL) Custom Value

1. Under **Custom Values**, click the **Add new value** button.
2. Provide a name for the Custom Value, select *Apply formula to a field* as **Type of Custom Value**, and click **Next.**

::Image[****]{src="https://support.deselect.com/hc/article_attachments/29439307599889" size="60" width="1310" height="1256" isUploading="false" darkWidth="1310" darkHeight="1256" showCaption="false"}

3. Select *Apply any function* as **Type of Formula&#x20;**&#x61;nd click **Next.**

::Image[]{src="https://support.deselect.com/hc/article_attachments/29439699148305" size="60" width="1310" height="1256" isUploading="false" darkWidth="1310" darkHeight="1256" showCaption="false"}

4. Select the type of value that you want to populate and use the board to write your query.

::Image[]{src="https://support.deselect.com/hc/article_attachments/29439699149585" size="60" width="1744" height="1240" isUploading="false" darkWidth="1744" darkHeight="1240" showCaption="false"}

:::Paragraph{listStyleType="disc" indent="2"}
Optionally, you can use the suggested functions via the **Insert Function** dropdown and clicking **Insert Formula** once you found the operator you need. The chosen formula including the parameters needed for it will be inserted on the board. You will then just need to replace the parameters with actual fields or text.
:::

:::Paragraph{listStyleType="disc" indent="2"}
Use the **Insert Field** function to automatically add the chosen Data Extension and field to the board as part of the parameters if necessary. Choose the Data Extension and field and click **Insert Field.**
:::

::Image[]{src="https://support.deselect.com/hc/article_attachments/29439699152145" size="60" width="732" height="454" isUploading="false" darkWidth="732" darkHeight="454" showCaption="false"}

5. Click **Check syntax** to validate the query and clic&#x6B;**&#x20;Save**
6. You can now move the new Custom Value over the Target Data Extension fields.

