split
  • 23 May 2023
  • Dark
    Light
  • PDF

split

  • Dark
    Light
  • PDF

Article summary

split Task Purpose

The split task is used to split a string into an array of substrings using a given separator or point where the split should take place. Once the split is executed, the result is a new array containing the split values. The original string is not changed.

Potential Use Case

A comma separated list of ticket numbers is provided to the automation. Using the split task, you are able to create an array of the ticket numbers for subsequent processing in the workflow.

Parameters

Input and output parameters are shown below.

Input Type Description
str String Required. The string to split.
separator String Specifies the point where each split should occur. The separator can be a single character or multiple characters. If the separator is omitted then the entire string becomes one single array element. If the separator is an empty string (“”) then every character of the string is separated.
limit Number Specifies the number of splits in a given string; items after the split limit are not included in the returned array. The limit parameter can be zero or a non-negative integer.


Output Type Description
splitArray Array An array of strings formed after splitting the given string at each point where the separator occurs.

Examples

In the IAP example shown below:

  • The incoming str variable is required.

    splitString-01

  • The variables are set prior to running the workflow. In the example below, the string is "Hello World". The letter "o" is the separator and the limit is set to "3".

    splitString-02

  • Once the workflow is executed, you can view the output in Task History, which is accessed from Jobs in Operations Manager. In the example, three (3) splits were made to the original input string, at each instance of the letter "o". Of note, split also looks for and includes white-space.

    splitString-03


Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.