---
sourceDocument: Australia Build workflows
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/build-workflows

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia Build workflows

ft:clusterId :

    - crworkflow

bundleId :

    - crworkflow

workflow :

    - Creator


---

# String

# String transform functions {#ariaid-title1}

* Release version: Australia
* 
* Updated March 12, 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 4 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 allow users to reformat or perform calculations on string data within ServiceNow.
These functions require a string input data pill, and applying them to the wrong data type will result in no transformation.
Customers should verify flow runtime values to ensure accuracy.
Show full answer Show less  

## Key Features

* **Convert String to Number:** Converts a string into a number.
* **Contains:** Checks if the input string contains a specified sequence of characters.
* **Does Not Contain:** Checks if the input string does not include a specified sequence.
* **Ends With:** Verifies if the input string ends with a specific sequence.
* **First Character:** Retrieves the first character of the input string.
* **Last Character:** Retrieves the last character of the input string.
* **Replace String:** Replaces parts of the input string based on a regex pattern.
* **Size:** Returns the total character count of the input string.
* **Split:** Divides the input string into an array based on a specified separator.
* **Starts With:** Checks if the input string starts with a specified sequence.
* **Substring:** Extracts a substring from the input string using defined start and end indexes.
* **To Lower Case:** Converts all characters of the input string to lowercase.
* **To Proper Case:** Capitalizes the first letter of each word in the input string.
* **To Upper Case:** Converts all characters of the input string to uppercase.
* **Trim:** Removes whitespace from the beginning and end of the input string.

## Key Outcomes

By utilizing these string transform functions, ServiceNow customers can enhance data processing capabilities, ensure accurate data manipulation, and improve the overall efficiency of their workflows. This allows for streamlined operations and better data management within the ServiceNow platform.  
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://servicenow-prod.fluidtopics.net/Ct3dsJ0IiWIcbamXVRVy2g "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://servicenow-prod.fluidtopics.net/16GAKmUMqo2akmwgAuG1TA "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.

## 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 6. 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 7. 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 8. 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 9. 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 10. 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 11. Example 1

* Input: `Example input string`
* Start Index: `3`
* End Index: `6`
* Output: `mple`
{#string-transform-functions__ul_pkz_dnz_jjb}  
Figure 12. 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 13. 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 14. 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 15. 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 16. 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.


