> For the complete documentation index, see [llms.txt](https://docs.fabricplan.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fabricplan.com/planning-sheets/how-tos/infobridge/data-transformations/text-functions.md).

# Text functions

Text functions in Infobridge help you prepare text fields for reporting, analysis, and writeback. Use **Extract** to create a new text column from an existing column by position, length, first characters, last characters, or delimiter. Use **Format** to change casing, remove leading or trailing spaces, or add a prefix or suffix.

You can find the text functions on the **Transform** tab in the **Text** group.

### Extract text

The **Extract** transformation creates a new column by extracting characters from a selected text column. You can extract characters by range, length, first characters, last characters, or delimiter.

#### Extract a range of text

Use **Range** to extract characters from a specific starting position for a fixed number of characters. The following example uses the **Postal Code** column, which contains values such as `79907Central`, where the first five characters represent the postal code.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FOgpYpZO3uCV728qZsi6n%2Fextract-range-source-postal-code.png?alt=media&amp;token=fc538c74-a180-4d51-a823-a5c1ca2efa0c" alt=""><figcaption></figcaption></figure>

1. On the **Transform** tab, in the **Text** group, select **Extract**.
2. In the **Extract** dialog, configure the extraction:

   1. In **Target column**, select **Postal Code**.
   2. In **Extract Type**, select **Range**.
   3. In **Starting Index**, enter `1`.
   4. In **Number of Characters**, enter `5`.<br>

   <figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FBuVuc9heHWnZJwPbecIJ%2Fextract-range-dialog-postal-code.png?alt=media&amp;token=0e6f3321-53f8-4fc0-851c-fbe4973ee8bc" alt=""><figcaption></figcaption></figure>
3. Select **Apply**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2F8fTYJJRorF1pgL0tZU77%2Fextract-range-result-postal-code.png?alt=media&amp;token=5b0563c9-e241-49e0-8f36-f0404ac4386a" alt=""><figcaption></figcaption></figure>

A new **Postal Code Range** column is created with the extracted five-character postal code values.

#### Extract text length

Use **Length** to return the number of characters in a text value. The following example uses the **Product Category** column and adds the length of each value as a new column.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FpBxvJmEaNympqbVkglGf%2Fextract-length-source-product-category.png?alt=media&amp;token=f2de82c0-9e24-402a-a5fd-58e0d929f17e" alt=""><figcaption></figcaption></figure>

1. On the **Transform** tab, in the **Text** group, select **Extract**.
2. In the **Extract** dialog, configure the extraction:

   1. In **Target column**, select **Product Category**.
   2. In **Extract Type**, select **Length**.<br>

   <figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FcNfWyLp3PoKu7ClB2CQO%2Fextract-length-dialog-product-category.png?alt=media&amp;token=1bdc08c1-d999-4548-95f9-f4492897022b" alt=""><figcaption></figcaption></figure>
3. Select **Apply**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FOQ73Ef1FBuPHe8Fr2rLk%2Fextract-length-result-product-category.png?alt=media&amp;token=cfaec340-9ea3-4f63-87ff-1ccb530275d3" alt=""><figcaption></figcaption></figure>

A new **Product Category Length** column is created with the character count for each value.

#### Extract the first or last characters

Use **First Characters** or **Last Characters** to extract a specified number of characters from the beginning or end of a text value.

The following example extracts the first five characters from the **Postal Code** column. The same workflow applies when extracting the last characters, except that you select **Last Characters** as the **Extract Type**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FOIpJuUmTQFWKwbcT5zGz%2Fextract-first-characters-source-postal-code.png?alt=media&amp;token=cef320bb-3144-4c6e-be14-6122202efd9b" alt=""><figcaption></figcaption></figure>

1. On the **Transform** tab, in the **Text** group, select **Extract**.
2. In the **Extract** dialog, configure the extraction:

   1. In **Target column**, select **Postal Code**.
   2. In **Extract Type**, select **First Characters**.
   3. In **Count**, enter `5`.

   <figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FSlkwnsGif4jnnx0ezif6%2Fextract-first-characters-dialog-postal-code.png?alt=media&amp;token=a50d2e1d-700e-4891-a90c-431956912a0d" alt=""><figcaption></figcaption></figure>
3. Select **Apply**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FrG96x2EUer3p6zggrP5d%2Fextract-first-characters-result-postal-code.png?alt=media&amp;token=eb24bb4b-6701-4a3a-9e06-e283326067c1" alt=""><figcaption></figcaption></figure>

A new **Postal Code First Characters** column is created with the first five characters from each postal code value.

#### Extract text before a delimiter

Use **Text Before Delimiters** to extract the text that appears before a specific delimiter. The following example uses the **Product Category** column, which contains values such as `Furniture-Bookcases`. The extraction returns the text before the hyphen (`-`).

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2F81fkhoZ36UxSDimLBsTL%2Ftext-before-delimiter-source-product-category.png?alt=media&amp;token=36cd8365-ada3-494c-8ae4-a8ccd7d47a1b" alt=""><figcaption></figcaption></figure>

1. On the **Transform** tab, in the **Text** group, select **Extract**.
2. In the **Extract** dialog, configure the extraction:

   1. In **Target column**, select **Product Category**.
   2. In **Extract Type**, select **Text Before Delimiters**.
   3. In **Delimiter**, enter `-`.<br>

   <figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FwtciYJ3lFmej3lC5bMZe%2Ftext-before-delimiter-dialog-product-category.png?alt=media&amp;token=43fb85df-c860-4933-a5a7-6852bc01d45a" alt=""><figcaption></figcaption></figure>
3. Select **Apply**.

   <figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2Ft1XF8WXateDBkzxABLqv%2Ftext-before-delimiter-result-product-category.png?alt=media&amp;token=6a1aa355-6866-47ae-af67-104d02620c7b" alt=""><figcaption></figcaption></figure>

A new **Product Category Before Delimiter** column is created. The column contains the text before the hyphen, such as `Furniture`.

#### Extract text after a delimiter

Use **Text After Delimiters** to extract the text that appears after a specific delimiter. The following example uses the **Product Category** column, which contains values such as `Furniture-Bookcases`. The extraction returns the text after the hyphen (`-`).

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FOvz2HFmrT5gDoVKeO9ga%2Ftext-after-delimiter-source-product-category.png?alt=media&amp;token=270090cc-62f8-4390-9344-3d27b0b5b3e0" alt=""><figcaption></figcaption></figure>

1. On the **Transform** tab, in the **Text** group, select **Extract**.
2. In the **Extract** dialog, configure the extraction:
   1. In **Target column**, select **Product Category**.
   2. In **Extract Type**, select **Text After Delimiters**.
   3. In **Delimiter**, enter `-`.<br>

      <figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FwtlONpFQxUR60DlrICzA%2Ftext-after-delimiter-dialog-product-category.png?alt=media&amp;token=c0d4844e-dd1e-4b4b-9336-520e9ae0975b" alt=""><figcaption></figcaption></figure>
3. Select **Apply**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2F9lSvto53XHsV5u27ACWw%2Ftext-after-delimiter-result-product-category.png?alt=media&amp;token=b06a6dcc-4073-4fd6-9012-7f9307d32835" alt=""><figcaption></figcaption></figure>

A new **Product Category After Delimiter** column is created. The column contains the text after the hyphen, such as `Bookcases` or `Chairs`.

### Format text

Use the **Format** transformation to modify text values in one or more columns.

You can convert text case, trim leading or trailing spaces, or add prefixes and suffixes.

1. On the **Transform** tab, in the **Text** group, select **Format**.
2. In the **Format** dialog, select **Formatting Type** to view the available options.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FknonRPl7XZvH1oHZVNDi%2Fformat-options-dialog.png?alt=media&amp;token=008236f6-122e-45d7-8874-69780ec3d435" alt=""><figcaption></figcaption></figure>

#### Convert text to uppercase or lowercase

Use **Uppercase** or **Lowercase** to convert text values in one or more selected columns.

The following example converts the **Region** and **Segment** columns to uppercase. The same workflow applies when converting text to lowercase, except that you select **Lowercase** as the **Formatting Type**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FT4YdAsHOQVNvAY76GV2L%2Fuppercase-source-region-segment.png?alt=media&amp;token=4e50d100-081f-4b1c-b47c-d87e89688e01" alt=""><figcaption></figcaption></figure>

1. On the **Transform** tab, in the **Text** group, select **Format**.
2. In the **Format** dialog, configure the formatting:

   1. In **Target column**, select **Region** and **Segment**.
   2. In **Formatting Type**, select **Uppercase**.<br>

   <figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FZ4ghnDU6xZZKDqqbQEIr%2Fuppercase-dialog-region-segment.png?alt=media&amp;token=f07158fc-67f0-4474-986f-0d6fed9fdcff" alt=""><figcaption></figcaption></figure>
3. Select **Apply**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FhwbWreL7SfDLOcUh4a9w%2Fuppercase-result-region-segment.png?alt=media&amp;token=07cf27eb-28a7-4254-b029-955b9a4e7c42" alt=""><figcaption></figcaption></figure>

The values in the **Region** and **Segment** columns are converted to uppercase.

#### Trim spaces

Use **Trim** to remove leading and trailing spaces from text values. The following example uses the **Product Classification** column to clean the product identifiers.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FzRSqgU9GKGzEBwcjwmxC%2Ftrim-source-product-classification.png?alt=media&amp;token=60f70e69-afc5-4e60-9460-5bf789c5669b" alt=""><figcaption></figcaption></figure>

1. On the **Transform** tab, in the **Text** group, select **Format**.
2. In the **Format** dialog, configure the formatting:

   1. In **Target column**, select **Product Classification**.
   2. In **Formatting Type**, select **Trim**.<br>

   <figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FqJ5K6u1PmHPxlEsGTuKm%2Ftrim-dialog-product-classification.png?alt=media&amp;token=b388554d-97de-4819-b927-c84f339c766c" alt=""><figcaption></figcaption></figure>
3. Select **Apply**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FiDhuflFl89aMAPv6jcUN%2Ftrim-result-product-classification.png?alt=media&amp;token=e5a3e474-c21a-4593-8ab6-c0602a12f1fa" alt=""><figcaption></figcaption></figure>

Leading and trailing spaces are removed from the **Product Classification** values.

#### Add a prefix or suffix

Use **Add prefix** or **Add suffix** to add a fixed text value before or after each value in a selected column.

The following example demonstrates how to add a prefix to the **Product Classification** column. The same workflow applies when adding a suffix, except that you specify a suffix value instead of a prefix.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2F1e3zJCaYTWtDBtxQgWUo%2Fadd-prefix-source-product-classification.png?alt=media&amp;token=730869c1-68ba-4e27-b1f0-05f6f7fa2e35" alt=""><figcaption></figcaption></figure>

1. On the **Transform** tab, in the **Text** group, select **Format**.
2. In the **Format** dialog, configure the formatting:

   1. In **Target column**, select **Product Classification**.
   2. In **Formatting Type**, select **Add prefix**.
   3. In **Prefix**, enter `PRD-`.<br>

   <figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FnxubPbTVIxkf13WSKjjE%2Fadd-prefix-dialog-product-classification.png?alt=media&amp;token=099cbdf2-d7b6-48ee-ab79-0032b299cf93" alt=""><figcaption></figcaption></figure>
3. Select **Apply**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2F0BY0CeKfuTtc6wHpDawZ%2Fadd-prefix-result-product-classification.png?alt=media&amp;token=b4fbf3da-739d-44da-b95f-80c655757f2c" alt=""><figcaption></figcaption></figure>

The **Product Classification** values are updated with the `PRD-` prefix.


---

# 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.fabricplan.com/planning-sheets/how-tos/infobridge/data-transformations/text-functions.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.
