---
schema_version: "1"
id: f9a87600951e738a5cdb9da807cedfbfa059a342edfb8112a2b4613b93ecde6b
title: Omnistudio String Functions
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_omnistudio_string_functions.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_string_functions.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 0b2ff7c2e3f982e03b8f1cd78c79d59f263b6ab8423005985dd6b44cf478d0e1
description: Functions that operate on strings.
products:
  - Omnistudio
release: "264"
---
# Omnistudio String Functions

Functions that operate on strings.

- **[Omnistudio BASE64ENCODE Function](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_string_functions.htm&release=264.0.0&type=5)**  
    Encodes an input value into Base64 format.
- **[Omnistudio CONCAT Function](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_string_functions.htm&release=264.0.0&type=5)**  
    Concatenates two or more strings into a single string.
- **[Omnistudio JOIN Function](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_string_functions.htm&release=264.0.0&type=5)**  
    Joins two or more string into a single string, separating each string by a specified token.
- **[Omnistudio MAXSTRING Function](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_string_functions.htm&release=264.0.0&type=5)**  
    Returns the string that is last lexicographically in a list of two or more strings.
- **[Omnistudio SPLIT Function](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_string_functions.htm&release=264.0.0&type=5)**  
    Splits a string into substrings at each position of a specified token.
- **[Omnistudio STRINGINDEXOF Function](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_string_functions.htm&release=264.0.0&type=5)**  
    Returns the start index of a substring within a string.
- **[Omnistudio SUBSTRING Function](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_string_functions.htm&release=264.0.0&type=5)**  
    Returns a substring of a string based on specified start and end indexes.
- **[Omnistudio TOSTRING Function](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_string_functions.htm&release=264.0.0&type=5)**  
    Converts input data into a string.

## Omnistudio BASE64ENCODE Function

Encodes an input value into Base64 format.

Base64 is a common ASCII-based encoding. In an encoded result, trailing `=` characters are padding.

### Signature

`BASE64ENCODE(data)`

### Return Value

String

### Parameters

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:50%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e172">
                  <p style="margin-bottom:0;">Parameter</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e178">
                  <p style="margin-bottom:0;">Data Type</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e184">
                  <p style="margin-bottom:0;">Necessity</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e190">
                  <p style="margin-bottom:0;">Description</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e172 ">
                  <p style="margin-bottom:0;"><code><var>data</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e178 ">
                  <p style="margin-bottom:0;">Any data type</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e184 ">
                  <p style="margin-bottom:0;">Required</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e190 ">
                  <p style="margin-bottom:0;">The input value to be encoded into Base64 format. The function does not accept
                    a null value or an empty string.</p>
                </td>

              </tr>
            </tbody>
          </table>

![String Encoding Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

String Encoding Example

Formula: `BASE64ENCODE("Encode this string.")`

Return value: `"RW5jb2RlIHRoaXMgc3RyaW5nLg=="`

![Date Encoding Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Date Encoding Example

Formula: `BASE64ENCODE("2003-02-01T16:35:30-0500")`

Return value: `"MjAwMy0wMi0wMVQxNjozNTozMC0wNTAw"`

![Number Encoding Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Number Encoding Example

Formula: `BASE64ENCODE(1024)`

Return value: `"MTAyNA=="`

![JSON Object Encoding Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

JSON Object Encoding Example

Sample data:

```
"Contact": {
  "FirstName": "Thomas",
  "MiddleName": "Alva",
  "LastName": "Edison"
}
```

Formula: `BASE64ENCODE(Contact)`

Return value: `"e0xhc3ROYW1lPUVkaXNvbiwgTWlkZGxlTmFtZT1BbHZhLCBGaXJzdE5hbWU9VGhvbWFzfQ=="`

## Omnistudio CONCAT Function

Concatenates two or more strings into a single string.

### Signature

`CONCAT(string...)`

### Return Value

String

### Parameters

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:50%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e363">
                  <p style="margin-bottom:0;">Parameter</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e369">
                  <p style="margin-bottom:0;">Data Type</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e375">
                  <p style="margin-bottom:0;">Necessity</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e381">
                  <p style="margin-bottom:0;">Description</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e363 ">
                  <p style="margin-bottom:0;"><code><var>string</var>...</code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e369 ">
                  <p style="margin-bottom:0;">String</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e375 ">
                  <p style="margin-bottom:0;">Required</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e381 ">
                  <p>A comma-separated list of one or more strings to be concatenated into a single string. To
                    separate input strings in the result, include a separator string (such as <code>" "</code>)
                    between each pair of strings. You can concatenate numbers, which the function coerces into
                    strings.</p>
                  <p style="margin-bottom:0;">If you specify only a single string, the function returns that string. If you specify
                    multiple strings, the function ignores null values and empty strings. You cannot specify
                    a null value or an empty string as the only input value.</p>
                </td>

              </tr>
            </tbody>
          </table>

![String and Number Concatentation Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

String and Number Concatentation Example

Formula: `CONCAT("AGE", ": ", 23)`

Return value: `"AGE: 23"`

![Number and String Concatentation Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Number and String Concatentation Example

Formula: `CONCAT(23, " years of age")`

Return value: `"23 years of age"`

![JSON Object Concatentation Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

JSON Object Concatentation Example

Sample data:

```
"stringField1": "abc",
"stringField2": "ABC"
```

Formula: `CONCAT(%stringField1%, " ", %stringField2%)`

Return value: `"abc ABC"`

![JSON Object Concatentation Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

JSON Object Concatentation Example

Sample data:

```
"Contact": {
  "FirstName": "Mike",
  "LastName": "Smith"
}
```

Formula: `CONCAT(Contact:FirstName, " ", Contact:LastName)`

Return value: `"Mike Smith"`

## Omnistudio JOIN Function

Joins two or more string into a single string, separating each string by a specified token.

### Signature

`JOIN(string..., token)`

### Return Value

String

### Parameters

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:50%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e571">
                  <p style="margin-bottom:0;">Parameter</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e577">
                  <p style="margin-bottom:0;">Data Type</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e583">
                  <p style="margin-bottom:0;">Necessity</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e589">
                  <p style="margin-bottom:0;">Description</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e571 ">
                  <p style="margin-bottom:0;"><code><var>string...</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e577 ">
                  <p style="margin-bottom:0;">String</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e583 ">
                  <p style="margin-bottom:0;">Required</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e589 ">
                  <p>A comma-separated list of one or more strings to be joined into a single string. In the
                    joined string, each specified string is separated by the <var>token</var>. You can
                    join numbers, which the function coerces into strings. If you specify only a single string
                    and a token, the function returns only the string.</p>
                  <p style="margin-bottom:0;">If you specify multiple values and any are null, the function omits the null values from
                    the joined string. If you specify multiple values and any are empty strings, the function
                    joins only the values that precede the empty string. You cannot specify a null value or an
                    empty string as the only input value.</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e571 ">
                  <p style="margin-bottom:0;"><code><var>token</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e577 ">
                  <p style="margin-bottom:0;">String</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e583 ">
                  <p style="margin-bottom:0;">Required</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e589 ">
                  <p style="margin-bottom:0;">A value to be placed between each input string at the position at which the strings are
                    joined. If you specify a number, the function coerces it into a string. If you specify an
                    empty string, the function omits the empty string from the joined string. If you specify
                    multiple input strings and no token, the function uses the last value of the input as the
                    token.</p>
                </td>

              </tr>
            </tbody>
          </table>

![Alphabetic Array Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Alphabetic Array Example

Sample data: `"AlphabeticArray": [ "a", "A", "b", "B", "c", "C" ]`

Formula: `JOIN(AlphabeticArray, ", ")`

Return value: `"a, A, b, B, c, C"`

![Numeric Array Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Numeric Array Example

Sample data: `"NumericArray": [ 1, 2, 3, 4 ]`

Formula: `JOIN(NumericArray, " / ")`

Return value: `"1 / 2 / 3 / 4"`

![JSON Object Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

JSON Object Example

Sample data:

```
"Contact": {
  "FirstName": "Thomas",
  "MiddleName": "Alva",
  "LastName": "Edison"
}
```

Formula: `JOIN(Contact:FirstName, Contact:MiddleName, Contact:LastName, " ")`

Return value: `"Thomas Alva Edison"`

![JSON Array Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

JSON Array Example

Sample data:

```
"Contacts": [
  {
    "id": "0036ab",
    "lastName": "Jones",
    "firstName": "Cathy"
  },
  {
    "id": "2787kq",
    "lastName": "Smith",
    "firstName": "Albert"
  },
  {
    "id": "3610xr",
    "lastName": "Smith",
    "firstName": "Ben"
  }
]
```

Formula: `JOIN(Contacts:id, ', ')`

Return value: `"0036ab, 2787kq, 3610xr"`

![Alphabetic List and No Token Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Alphabetic List and No Token Example

Formula: `JOIN("a", "b", "c")`

Formula: `JOIN(("a", "b", "c"))`

Return value: `"acb"`

## Omnistudio MAXSTRING Function

Returns the string that is last lexicographically in a list of two or more strings.

The function performs case-sensitive comparisons of the input strings.

### Signature

`MAXSTRING(string...)`

### Return Value

String

### Parameters

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:50%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e836">
                  <p style="margin-bottom:0;">Parameter</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e842">
                  <p style="margin-bottom:0;">Data Type</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e848">
                  <p style="margin-bottom:0;">Necessity</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e854">
                  <p style="margin-bottom:0;">Description</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e836 ">
                  <p style="margin-bottom:0;"><code><var>string</var>...</code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e842 ">
                  <p style="margin-bottom:0;">String</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e848 ">
                  <p style="margin-bottom:0;">Required</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e854 ">
                  <p>Two or more strings from which the string that is last lexicographically is to
                    be returned. If you specify numbers, the function coerces them into strings.</p>
                  <p style="margin-bottom:0;">If you specify only a single string, the function returns that string. If you
                    specify multiple strings, the function ignores null values and empty strings.
                    You cannot specify a null value or an empty string as the only input value.</p>
                </td>

              </tr>
            </tbody>
          </table>

![Maximum String Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Maximum String Example

Formula: `MAXSTRING("Amy", "Ziggy", "Michael")`

Return value: `"Ziggy"`

![Maximum Number Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Maximum Number Example

Formula: `MAXSTRING(1, 2, 3)`

Return value: `"3"`

![Uppercase Characters Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Uppercase Characters Example

Formula: `MAXSTRING("A", "B", "C")`

Return value: `"C"`

![Uppercase and Lowercase Characters Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Uppercase and Lowercase Characters Example

Formula: `MAXSTRING("A", "b", "C")`

Return value: `"b"`

## Omnistudio SPLIT Function

Splits a string into substrings at each position of a specified token.

The function performs a case-sensitive search for the token. If it splits the input string into two or more substrings, the function returns an array of strings. Otherwise, it returns the input string.

### Signature

`SPLIT(string, token)`

### Return Value

String\[\]

### Parameters

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:50%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e1035">
                  <p style="margin-bottom:0;">Parameter</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e1041">
                  <p style="margin-bottom:0;">Data Type</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e1047">
                  <p style="margin-bottom:0;">Necessity</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e1053">
                  <p style="margin-bottom:0;">Description</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1035 ">
                  <p style="margin-bottom:0;"><code><var>string</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1041 ">
                  <p style="margin-bottom:0;">String</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1047 ">
                  <p style="margin-bottom:0;">Required</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1053 ">
                  <p style="margin-bottom:0;">The string to be split into substrings. If you specify a number, the function coerces it
                    into a string. The string cannot be null or an empty string.</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1035 ">
                  <p style="margin-bottom:0;"><code><var>token</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1041 ">
                  <p style="margin-bottom:0;">String</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1047 ">
                  <p style="margin-bottom:0;">Required</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1053 ">
                  <p>A string that specifies the position at which the input string is to be split into
                    substrings. The token is interpreted as a Java regular expression (regex) pattern. Special
                    regex characters such as <code>.</code>, <code>*</code>, <code>+</code>,
                    <code>?</code>, <code>|</code>, <code>(</code>, <code>)</code>,
                    <code>[</code>, <code>]</code>, <code>{</code>, <code>}</code>,
                    <code>^</code>, <code>$</code>, and <code>\</code> have special meaning. To
                    split on a literal special character, escape it with a backslash
                    (<code>\</code>). For example, to split on a period, use <code>\.</code> as the
                    token. The function splits the string at each occurrence of the token. It does not include
                    the token in the substrings that it returns. If you specify a number, the function coerces
                    it into a string. The function returns the input string if the token is not present in the
                    string.
                  </p>
                  <p style="margin-bottom:0;">If you specify a null token, the function returns the input string. If you specify an
                    empty string as the token, the function returns an array that includes each character of
                    the input value.</p>
                </td>

              </tr>
            </tbody>
          </table>

![Split String Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Split String Example

Sample data: `%Name% == "Anne Marie Gupta"`

Formula: `SPLIT(%Name%, " ")`

Return value: `[ "Anne", "Marie", "Gupta" ]`

![Split Number Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Split Number Example

Formula: `SPLIT(12345, 3)`

Return value: `[ "12", "45" ]`

![Token Not Found Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Token Not Found Example

Formula: `SPLIT("abcde", "C")`

Return value: `"abcde"`

## Omnistudio STRINGINDEXOF Function

Returns the start index of a substring within a string.

The function performs a case-sensitive search for the substring. The position of the first character in the string is `0`. If the substring occurs multiple times in the string, the function returns the index of the first occurence. If it doesn't find the substring in the string, the function returns `-1`.

### Signature

`STRINGINDEXOF(string, substring)`

### Return Value

Integer

### Parameters

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:50%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e1307">
                  <p style="margin-bottom:0;">Parameter</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e1313">
                  <p style="margin-bottom:0;">Data Type</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e1319">
                  <p style="margin-bottom:0;">Necessity</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e1325">
                  <p style="margin-bottom:0;">Description</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1307 ">
                  <p style="margin-bottom:0;"><code><var>string</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1313 ">
                  <p style="margin-bottom:0;">String</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1319 ">
                  <p style="margin-bottom:0;">Required</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1325 ">
                  <p style="margin-bottom:0;">The string in which to search for the <code>substring</code>. If you specify a number,
                    the function coerces it into a string. The string cannot be null or an empty string.</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1307 ">
                  <p style="margin-bottom:0;"><code><var>substring</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1313 ">
                  <p style="margin-bottom:0;">String</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1319 ">
                  <p style="margin-bottom:0;">Required</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1325 ">
                  <p style="margin-bottom:0;">The substring for which to search in the <code>string</code>. If you specify a number,
                    the function coerces it into a string. The substring cannot be null or an empty string.</p>
                </td>

              </tr>
            </tbody>
          </table>

![Substring Found Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Substring Found Example

Formula: `STRINGINDEXOF("This is the test string.", "test")`

Return value: `12`

![Substring Not Found Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Substring Not Found Example

Formula: `STRINGINDEXOF("This is the test string.", "testy")`

Return value: `-1`

![Multiple Occurrences of Substring Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Multiple Occurrences of Substring Example

Formula: `STRINGINDEXOF("The string of strings.", "string")`

Return value: `4`

![Numeric Values Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Numeric Values Example

Formula: `STRINGINDEXOF(1234, 34)`

Return value: `2`

## Omnistudio SUBSTRING Function

Returns a substring of a string based on specified start and end indexes.

The position of the first character in the `string` is `0`. The position of the last character in the `string` is the length of the string. The function performs a case-sensitive search for a character or string used as a start or end index.

### Signature

`SUBSTRING(string, startIndex, endIndex)`

### Return Value

String

### Parameters

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:50%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e1549">
                  <p style="margin-bottom:0;">Parameter</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e1555">
                  <p style="margin-bottom:0;">Data Type</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e1561">
                  <p style="margin-bottom:0;">Necessity</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e1567">
                  <p style="margin-bottom:0;">Description</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1549 ">
                  <p style="margin-bottom:0;"><code><var>string</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1555 ">
                  <p style="margin-bottom:0;">String</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1561 ">
                  <p style="margin-bottom:0;">Required</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1567 ">
                  <p style="margin-bottom:0;">The string from which a substring is to be returned. The string cannot be null or
                    an empty string.</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1549 ">
                  <p style="margin-bottom:0;"><code><var>startIndex</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1555 ">
                  <p style="margin-bottom:0;">Integer or string</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1561 ">
                  <p style="margin-bottom:0;">Optional</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1567 ">
                  <p>The position of the first character in the substring. The start index is inclusive,
                    so the position of the fist character is <code>0</code>.</p>
                  <ul>
                    <li>
                      <p>If you specify a negative integer or an integer that is greater than the length
                        of the string, the function uses <code>0</code>.</p>
                    </li>

                    <li>
                      <p>If you specify a single character, the function uses the position of the first
                        occurrence of that character.</p>
                    </li>

                    <li>
                      <p>If you specify a string, the function uses the position of the first character
                        of the first occurrence of the string.</p>
                    </li>

                    <li>
                      <p>If you specify null or an empty string, the function uses <code>0</code>.</p>
                    </li>

                  </ul>
                  <p style="margin-bottom:0;">If you omit a start index, the function uses <code>0</code> by default. In this
                    case, you must also omit the end index.</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1549 ">
                  <p style="margin-bottom:0;"><code><var>endIndex</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1555 ">
                  <p style="margin-bottom:0;">Integer or string</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1561 ">
                  <p style="margin-bottom:0;">Optional</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e1567 ">
                  <p>The position of the last character in the substring. The end index is exclusive,
                    so the position of the last character is the length of the string.</p>
                  <ul>
                    <li>
                      <p>If you specify a negative integer or an integer that is greater than the length
                        of the string, the function uses the length of the string.</p>
                    </li>

                    <li>
                      <p>If you specify a single character, the function uses the position of the first
                        occurrence of that character minus one.</p>
                    </li>

                    <li>
                      <p>If you specify a string, the function uses the position of the first character of
                        the first occurrence of the string minus one.</p>
                    </li>

                    <li>
                      <p>If you specify null or an empty string, the function uses the length of the string.</p>
                    </li>

                  </ul>
                  <p style="margin-bottom:0;">If you omit an end index, the function uses the length of the string by default. If
                    you specify an end index, you must also specify a start index.</p>
                </td>

              </tr>
            </tbody>
          </table>

![No Start or End Index Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

No Start or End Index Example

Sample data: `"InputString": "The string."`

Formula: `SUBSTRING(InputString)`

Return value: `"The string."`

![Numeric Start Index Only Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Numeric Start Index Only Example

Sample data: `"InputString": "The string."`

Formula: `SUBSTRING(InputString, 4)`

Return value: `"string."`

![Numeric Start and End Indexes Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Numeric Start and End Indexes Example

Sample data: `"InputString": "The string."`

Formula: `SUBSTRING(InputString, 0, 11)`

Return value: `"The string."`

![Numeric Start and End Indexes Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Numeric Start and End Indexes Example

Sample data: `"InputString": "The string."`

Formula: `SUBSTRING(InputString, 0, 4)`

Return value: `"The "`

![Numeric Start and End Indexes Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Numeric Start and End Indexes Example

Sample data: `"InputString": "The string."`

Formula: `SUBSTRING(InputString, 4, 10)`

Return value: `"string"`

![Character Start Index Only Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Character Start Index Only Example

Sample data: `"InputString": "The string."`

Formula: `SUBSTRING(InputString, "r")`

Return value: `"ring."`

![Character Start and End Indexes Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Character Start and End Indexes Example

Sample data: `"InputString": "The string."`

Formula: `SUBSTRING(InputString, "r", ".")`

Return value: `"ring"`

![String Start Index Only Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

String Start Index Only Example

Sample data: `"InputString": "The string."`

Formula: `SUBSTRING(InputString, "string")`

Return value: `"string."`

![String Start and End Indexes Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

String Start and End Indexes Example

Sample data: `"InputString": "The string."`

Formula: `SUBSTRING(InputString, "The", "ring.")`

Return value: `"The st"`

![String Start and End Indexes Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

String Start and End Indexes Example

Formula: `SUBSTRING("The string of strings.", "The", "ring")`

Return value: `"The st"`

## Omnistudio TOSTRING Function

Converts input data into a string.

### Signature

`TOSTRING(data)`

### Return Value

String

### Parameters

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:50%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e2000">
                  <p style="margin-bottom:0;">Parameter</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e2006">
                  <p style="margin-bottom:0;">Data Type</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e2012">
                  <p style="margin-bottom:0;">Necessity</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d80429e2018">
                  <p style="margin-bottom:0;">Description</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e2000 ">
                  <p style="margin-bottom:0;"><code><var>data</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e2006 ">
                  <p style="margin-bottom:0;">Any data type</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e2012 ">
                  <p style="margin-bottom:0;">Required</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d80429e2018 ">
                  <p style="margin-bottom:0;">The data to be converted into a string. The function does not accept a null value or an
                    empty string.</p>
                </td>

              </tr>
            </tbody>
          </table>

![Single Number Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Single Number Example

Formula: `TOSTRING(3.0)`

Return value: `"3.0"`

![JSON Object Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

JSON Object Example

Formula: `TOSTRING({ "key": "value" })`

Return value: `"key, value"`

![JSON Object Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

JSON Object Example

Formula: `TOSTRING({ "Amount": 750.00 })`

Return value: `"Amount, 750.00"`

![Quoted JSON Object Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Quoted JSON Object Example

Formula: `TOSTRING('{ "key": "value" }')`

Return value: `"{ "key": "value" }"`

![JSON Array Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

JSON Array Example

Formula: `TOSTRING([ { "key1": "value1" }, { "key2": "value2" } ])`

Return value: `"key1, value1, key2, value2"`