---
sourceDocument: Brazil Build workflows
sourceDocumentLink: https://www.servicenow.com/docs/r/build-workflows

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Build workflows

ft:clusterId :

    - crworkflow

bundleId :

    - crworkflow

workflow :

    - Creator


---

# String

# String transform functions {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 5 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of String transform functions

String transform functions in ServiceNow allow you to reformat or perform calculations on string data pills within flows.
These functions require string-type input data pills and will return the original value if applied to incompatible types.
They enable practical string manipulations such as conversions, searches, modifications, and case transformations to support automation tasks and data processing.
Show full answer Show less  

## Key Functions and Their Uses

* **Convert String to Number:** Converts string input into a numeric value for calculations or comparisons.
* **Contains / Does not Contain:** Boolean checks if a string includes or excludes specified character sequences.
* **Ends With / Starts With:** Determines if a string ends or starts with a particular substring.
* **First Character / Last Character:** Extracts the first or last character from a string, useful for generating codes or abbreviations.
* **Get Display Value / Get Value:** Retrieves the display or actual value from Choice fields for use in notifications or logic.
* **Replace String:** Performs regex-based replacements within strings, allowing advanced pattern substitutions.
* **Size:** Returns the total number of characters in a string, helping validate string lengths.
* **Split:** Divides a string into an array using a specified delimiter, facilitating processing of lists or CSV data.
* **Substring:** Extracts a portion of a string based on start and end indices, useful for parsing fixed-format data.
* **To Lower Case / To Upper Case / To Proper Case:** Converts text to all lowercase, all uppercase, or capitalizes the first letter of each word respectively for consistent formatting.
* **Trim:** Removes leading and trailing whitespace from strings, ensuring clean data before storage or further processing.

## Practical Application Examples

* Use **First Character** to generate a city code when creating or updating user records.
* Retrieve Choice field display or actual values to include meaningful information in email notifications.
* Apply **Replace String** with regex to sanitize or reformat input strings dynamically.
* Use **Split** to convert comma-separated values into arrays for iterative processing within flows.
* Use **Trim** after receiving external data to clean whitespace before creating configuration items.

## Why It Matters

These string transform functions empower ServiceNow customers to automate complex string handling easily within flows without custom scripting. They improve data quality, support dynamic content generation, and enable precise control over string data transformations critical for integration, notifications, and record updates.

## What to Expect

By applying these functions correctly with appropriate input data pills, you can reliably transform string data to meet your workflow and integration requirements. Incorrect input types result in untransformed data being returned, so verifying input types is important. These functions streamline common string operations, reducing manual effort and enhancing flow efficiency.  
Use string transform functions to reformat or perform calculations on String data
pills.
String transform functions require a String input data pill. Make sure to use the correct
input [data pill type](https://www.servicenow.com/docs/yLOTm7VwCQT5OxQXwGypsg "Actions and subflows use variables to store input and output data. The variable data type determines what kind of data it stores and its advanced configuration options.") when applying string
transform functions. If a string transform function is applied to an improper data type, the
data is not transformed at runtime and the input value is returned instead. For more
information on confirming your flow runtime values, see [Test a flow](https://www.servicenow.com/docs/E9rEpzEOdS2Lxb1CVorvIQ "Before activating a flow so other users can access it, test to make certain it works the way you expect.").

## Convert String to Number {#string-transform-functions__section_dmq_3lk_hrb}

Converts a string into a number.
{#string-transform-functions__table_xjp_llk_hrb__entry__2}

| Input data pill | Output data pill |
|-|-|
| String | Number - Number converted from a string. |
[ ]

{#string-transform-functions__table_xjp_llk_hrb} Figure 1. Example

* Input: `"500"`
* Output: `500`
{#string-transform-functions__ul_yq4_plk_hrb}

## Contains {#string-transform-functions__section_ndv_q54_mpb}

Returns true when the input string contains a given sequence of
characters.  
{#string-transform-functions__table_wd2_x54_mpb__entry__3}

| Input data pill | Parameters | Output data pill |
|-|-|-|
| String | Characters to search for. | Boolean indicating whether a sequence of characters exists in the input string |
[ ]

{#string-transform-functions__table_wd2_x54_mpb}  
Figure 2. Example

* Input: `Cheese Pizza`
* Parameter: `Cheese`
* Output: `true`
{#string-transform-functions__ul_cbn_dv4_mpb}

## Does not Contain {#string-transform-functions__section_zk4_r54_mpb}

Returns true when the input string does not contain a given sequence
of characters.  
{#string-transform-functions__table_bpj_mv4_mpb__entry__3}

| Input data pill | Parameters | Output data pill |
|-|-|-|
| String | Characters to search for. | Boolean indicating whether a sequence of characters does not exist in the input string |
[ ]

{#string-transform-functions__table_bpj_mv4_mpb}  
Figure 3. Example

* Input: `Cheese Pizza`
* Parameter: `Joey`
* Output: `true`
{#string-transform-functions__ul_kkd_qv4_mpb}

## Ends With {#string-transform-functions__section_kqc_s54_mpb}

Returns true when the input string ends with a given sequence of
characters.  
{#string-transform-functions__table_zck_wv4_mpb__entry__3}

| Input data pill | Parameters | Output data pill |
|-|-|-|
| String | Characters to search for. | Boolean indicating whether the input string ends with the given sequence of characters |
[ ]

{#string-transform-functions__table_zck_wv4_mpb}  
Figure 4. Example

* Input: `Cheese Pizza`
* Parameter: `Pizza`
* Output: `true`
{#string-transform-functions__ul_wvj_2w4_mpb}

## First Character {#string-transform-functions__first-character}

Returns the first character of the input String.  
{#string-transform-functions__table_lq2_rdg_mkb__entry__2}

| Input data pill | Output data pill |
|-|-|
| String | String - Transformed String as the first character of the input String |
[ ]

{#string-transform-functions__table_lq2_rdg_mkb}  
Figure 5. Example

* Input: `Madrid`
* Output: `M`

{#string-transform-functions__ul_pby_rdz_jjb}

In this example, the flow triggers when a User \[sys_user\] record is created. The flow
then updates the City field for the User \[sys_user\] record with a
code that is represented as the first character of the city's name.

## Get Display Value {#string-transform-functions__section_qgw_5vk_4jc}

Returns the display value of the input Choice field.  
{#string-transform-functions__table_dcb_dwk_4jc__entry__2}

| Input data pill | Output data pill |
|-|-|
| Data pill path to Choice field. | String - Display value for the Choice field data pill. |
[ ]

{#string-transform-functions__table_dcb_dwk_4jc}  
Figure 6. Example

* Input: \[Trigger\]\[Incident Record\]\[State\]
* Output: `On Hold`

{#string-transform-functions__ul_fcb_dwk_4jc}

In this example, the flow triggers when an incident record is created. The flow looks up the value of the State field for use in an email notification.


## Get Value {#string-transform-functions__section_mkw_bzk_4jc}

Returns the actual value of the input Choice field.  
{#string-transform-functions__table_nkw_bzk_4jc__entry__2}

| Input data pill | Output data pill |
|-|-|
| Data pill path to Choice field. | String - Actual value for the Choice field data pill. |
[ ]

{#string-transform-functions__table_nkw_bzk_4jc}  
Figure 7. Example

* Input: \[Trigger\]\[Incident Record\]\[State\]
* Output: `3`

{#string-transform-functions__ul_pkw_bzk_4jc}

In this example, the flow triggers when an incident record is created. The flow looks up the value of the State field for use in an email notification.


## Last Character {#string-transform-functions__section_rhh_tzx_2jb}

Returns the last character of the input String.  
{#string-transform-functions__table_tll_rhg_mkb__entry__2}

| Input data pill | Output data pill |
|-|-|
| String | String - Transformed String as the last character of the input String |
[ ]

{#string-transform-functions__table_tll_rhg_mkb}  
Figure 8. Example

* Input: `Madrid`
* Output: `d`
{#string-transform-functions__ul_opv_3cz_jjb}

## Replace String {#string-transform-functions__section_cty_s54_mpb}

Returns a replaced string from the input string based on the provided regular expression (regex) and replacement string. Use the JavaScript regular expression format.  
{#string-transform-functions__table_el5_3w4_mpb__entry__3}

| Input data pill | Parameters | Output data pill |
|-|-|-|
| String | * Regex - Regular expression to be matched for replacement * Replace String - Replacement string {#string-transform-functions__ul_xdx_jw4_mpb} | Resulting string after replacement with given parameters |
[ ]

{#string-transform-functions__table_el5_3w4_mpb}  
Figure 9. Example

* Input: `"Example input string."`
* Parameters:
  * Regex: `\"`
  * Replacement string: `\\\"`
  {#string-transform-functions__ul_ccj_zw4_mpb}
* Output: `\"Example input string.\"`
{#string-transform-functions__ul_vmq_tw4_mpb}

## Size {#string-transform-functions__section_i4n_tzx_2jb}

Returns the total number of characters in the input String.  
{#string-transform-functions__table_k4c_31n_mkb__entry__2}

| Input data pill | Output data pill |
|-|-|
| String | Integer |
[ ]

{#string-transform-functions__table_k4c_31n_mkb}  
Figure 10. Example

* Input: `Example input string.`
* Output: `21`
{#string-transform-functions__ul_br1_cfz_jjb}

## Split {#string-transform-functions__section_tx4_tzx_2jb}

Returns an Array.String based on a provided Separator that splits
the input String. If the Separator field is left blank, the
transformation is ignored and the system returns the input String. If entering any data type
other than a String as the Separator, the system converts the
provided value to a String.  
{#string-transform-functions__table_igr_41n_mkb__entry__3}

| Input data pill | Parameters | Output data pill |
|-|-|-|
| String | Separator - Enter a delimiter that specifies where the input String should be split. If left blank, the input String is not transformed at runtime. | Array.String - An array of substrings from the input String |
[ ]

{#string-transform-functions__table_igr_41n_mkb}  
Figure 11. Example

* Input: `Example, input, string.`
* Separator: `,`
* Output: `["Example", "input", "string."]`
{#string-transform-functions__ul_unn_xjz_jjb}

## Starts With {#string-transform-functions__section_u3s_t54_mpb}

Returns true when the input string starts with a given sequence of
characters.  
{#string-transform-functions__table_js2_2x4_mpb__entry__3}

| Input data pill | Parameters | Output data pill |
|-|-|-|
| String | Characters to search for. | Boolean indicating whether the input string starts with the given sequence of characters |
[ ]

{#string-transform-functions__table_js2_2x4_mpb}  
Figure 12. Example

* Input: `Cheese Pizza`
* Parameter: `Chees`
* Output: `true`
{#string-transform-functions__ul_ls2_2x4_mpb}

## Substring {#string-transform-functions__section_l25_tzx_2jb}

Returns a substring from the input String that is based on the provided Start Index and End Index. Input String index starts at
0.  
{#string-transform-functions__table_orx_v1n_mkb__entry__3}

| Input data pill | Parameters | Output data pill |
|-|-|-|
| String | * Start Index - Index of the first character to include in the returned substring * End Index - Index of the last character to include in the returned substring {#string-transform-functions__ul_g5q_xmz_jjb} | String - Transformed String as a substring of the input String |
[ ]

{#string-transform-functions__table_orx_v1n_mkb}  
Note:  
If the Start Index value is longer than the string's length, then the transform function returns the input string. This behavior is different from the JavaScript substring() method, which instead returns an empty string.  
Figure 13. Example 1

* Input: `Example input string`
* Start Index: `3`
* End Index: `6`
* Output: `mple`
{#string-transform-functions__ul_pkz_dnz_jjb}  
Figure 14. Example 2

* Input: `Example input string`
* Start Index: `30`
* End Index: `40`
* Output: `Example input string`
{#string-transform-functions__ul_mmn_m2j_jhc}

## To Lower Case {#string-transform-functions__section_atv_tzx_2jb}

Converts the input String to all lowercase characters.  
{#string-transform-functions__table_o3t_nbn_mkb__entry__2}

| Input data pill | Output data pill |
|-|-|
| String | String in all lowercase characters |
[ ]

{#string-transform-functions__table_o3t_nbn_mkb}  
Figure 15. Example

* Input: `ExamPle inpuT stRing`
* Output: `example input string`
{#string-transform-functions__ul_r2z_x41_kjb}

## To Proper Case {#string-transform-functions__section_a4y_3wv_knb}

Changes the case of words in the input string. Capitalizes the first letter of each word
and makes the remaining letters in the word lower case. A word is considered any string
separated by a space, hyphen, backslash, or forward slash character. The transform function
always evaluates words from left-to-right to determine the first letter.  
{#string-transform-functions__table_ld1_m1w_knb__entry__2}

| Input data pill | Output data pill |
|-|-|
| String | String in proper case |
[ ]

{#string-transform-functions__table_ld1_m1w_knb}  
Figure 16. Example

* Input: `exAMPle-input string/TEXT`
* Output: `Example-Input String/Text`
{#string-transform-functions__ul_qxj_4wv_knb}

## To Upper Case {#string-transform-functions__section_hrw_tzx_2jb}

Converts the input String to all uppercase characters.  
{#string-transform-functions__table_lsr_dcn_mkb__entry__2}

| Input data pill | Output data pill |
|-|-|
| String | String in all uppercase characters |
[ ]

{#string-transform-functions__table_lsr_dcn_mkb}  
Figure 17. Example

* Input: `ExamPle inpuT stRing`
* Output: `EXAMPLE INPUT STRING`
{#string-transform-functions__ul_qkn_dbp_kkb}

## Trim {#string-transform-functions__section_r2l_tzx_2jb}

Removes white space from the beginning and end of the input String. Does not remove white
space within the input String.  
{#string-transform-functions__table_rcg_pcn_mkb__entry__2}

| Input data pill | Output data pill |
|-|-|
| String | String - Transformed String with trimmed white space |
[ ]

{#string-transform-functions__table_rcg_pcn_mkb}  
Figure 18. Example

* Input: ` SQL Server APAC 1 `
* Output: `SQL Server APAC 1`

{#string-transform-functions__ul_b2y_z41_kjb}

In this example, the action makes a REST call to a third-party system and GETs a
response body containing data about a server. Then, the Trim transform function removes
any unwanted white space before adding the server's name to a new record in the Server
\[cmdb_ci_server\] table.

*[\>]: and then


