List Functions

Mike Jones
Mike Jones
  • Updated

List functions are useful for working with list or array data types. The functions provided can help you extract list values and manipulate a list order.

List Functions

First

The First Function returns the first element of a list. 

Configuration:

You can configure the Node Label and Description on this function. There are no other configurable fields. The function should be connected to a node that passes in a List/Array of values.

Example:

Input list,

["one", "two", "three"]

Output,

"one"

 

Join

The join function returns a new String composed of copies of the CharSequence elements joined together with a copy of the specified delimiter.

Note that if an element is null, then this function ignores null values.

Configuration:

mceclip0.png

1. Enter a label for the node. This will be helpful with identifying the node when viewing your Entity Pipeline.

2. Enter a Description that will explain the criteria configured.

3. Enter the Delimiter to be used when joining each value in a list. 

4. The Insert Token option allows you to set as a field token in order to dynamically set the delimiter value. 

Example

Input List: ["one","two","three"]

Delimiter: -

Output value: one-two-three

 

Last

The Last Function returns the last element of a list. 

Configuration:

You can configure the Node Label and Description on this function. There are no other configurable fields. The function should be connected to a node that passes in a List/Array of values.

Example:

Input list,

["one", "two", "three"]

Output,

"three"

 

Reverse

The Reverse Function reverses the order of the elements in a given list.

Configuration:

You can configure the Node Label and Description on this function. There are no other configurable fields. The function should be connected to a node that passes in a List/Array of values

Example:

Input List,

["one", "two", "three"]

Output,

["three", "two", "one"]

 

Sort

Sort can be used to sort elements of a given list in ascending order. It is based on the underlying core Java java.lang.Comparable interface.

Configuration:

You can configure the Node Label and Description on this function. There are no other configurable fields. The function should be connected to a node that passes in a List/Array of values.

Example:

Input List,

[2,1,4,3]

Output,

[1,2,3,4]

 

Remove Duplicates

Remove Duplicates function is used to remove duplicate elements in a given list. It retains the order of the original list.

Configuration:

Only input configuration to this function is "Input List". This is typically a token that resolves to a List value. If this configuration is empty, then the input to this function would be used to remove duplicates.

Note: This function only works with List which has primitive types like String, Integer and Double.

Example:

Input List,

[2, 1, 2, 3, 4, 1]

Output,

[2, 1, 3, 4]

 

Share this

Was this article helpful?

0 out of 0 found this helpful