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

 

NOTE

When using functions in an Entity pipeline, an additional Value field appears which is the input value that needs to be processed by the function.

 

First

The First Function returns the first element of a list. 

Configuration:

You can configure the Display Label and Description on this function. There are no other configurable attributes. 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:

1. Enter a Display 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. 

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 Display Label and Description on this function. There are no other configurable attributes. 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 List

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

Configuration:

You can configure the Display Label and Description on this function. There are no other configurable attributes. 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 Display Label and Description on this function. There are no other configurable attributes. 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:

You can configure the Display Label, Description and Input List on this function. 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