join

Prev Next

Task Purpose

The join task is used to join all elements of an array (or an array-like object) into a string.

Potential Use Case

If you have a dataset that is within an array and you want to join this dataset into a string of information, you can do this by using the join task.

Task Properties

Input and output properties are shown below.

Incoming Type Description
arr Array Required. The array that contains the elements to join.
separator String Specifies a string to separate each pair of adjacent elements of the array.

 

Outgoing Type Description
joinedElements String A string with all array elements joined. The task will return an empty string if the length of the array is 0.

How to Configure the Task

In this example the arr variable is ["Device1", "Device2", "Device3", "Device4"] and the separator to use is a comma (" , ").

Figure 1: Array Input
join-ex03-input


Figure 2: Separator String
join-ex05-input


The joinedElements variable that returns is "Device1,Device2,Device3,Device4" with all of the elements separated by a comma (" , ") within one set of double quotation marks.

Figure 3: Output

join-ex04-output

Related Reading

For related information on the join task, see the join API reference.