Free cookie consent management tool by TermsFeed

merge() Function

On This Page

Takes a variable number of lists and merges them into a single list (or a list of lists) that is the size of the largest list provided.

Parameters

merge( list )

Keyword Type Description

list

Any Type Array

Variable number of lists to merge into one list.

Returns

Any Type

Using the function

Use the merge() function when you have a looping function that references a rule or function that takes more than one argument. The order of the argument must match the order of your rule input parameters.

Shorter lists are padded with null entries.

Examples

The following examples demonstrate the merge() function.

To experiment with examples, copy and paste the expression into an expression rule and click TEST RULE to see the output.

Merging two lists of the same length

This example creates a list with three nested lists.

1
2
3
4
merge(
  {1, 2, 3},
  {4, 5, 6}
)

Returns {{1, 4}, {2, 5}, {3, 6}}.

Merging many lists of the same length

This example creates a list with two nested lists.

1
2
3
4
5
6
merge(
  {1, 2},
  {true, false},
  {"a", "b"},
  {10,20}
)

Returns {{1, true, "a", 10}, {2, false, "b", 20}}.

Merging two lists of the different lengths

This example creates a list with three nested lists.

1
2
3
4
merge(
  {1, 2, 3},
  {4, 5}
)

Returns {{1, 4}, {2, 5}, {3, null}}.

Merging a single list

This example creates a list with two nested lists.

1
2
3
merge(
  {1, 2}
)

Returns {{1}, {2}}.

Use merge() in the filter() function

The following expression illustrates a list being filtered by the function a!isUserMemberOfGroup and two parameters which accept lists need to be passed in the context parameter of filter().

1
2
3
4
5
filter(
  a!isUserMemberOfGroup,
  {"user1", "user2", "user3"},
  merge({cons!myGroup1, cons!myGroup2}, {true, true})
)

Returns {"user1"} when only user1 is a member of the groups referenced in cons!myGroup1 and cons!myGroup2. The merge function maps the list values to the correct parameters in this example.

Feature compatibility

The table below lists this function's compatibility with various features in Appian.
Feature Compatibility Note
Portals Compatible
Offline Interfaces Compatible
Sync-Time Custom Record Fields Compatible

Can be used to create a custom record field that only evaluates at sync time.

Real-Time Custom Record Fields Incompatible

Custom record fields that evaluate in real time must be configured using one or more Custom Field functions.

Process Reports Incompatible

Cannot be used to configure a process report.

Process Events Partially compatible

If autoscale is enabled, can be used to configure a supported process event node (such as a start event or timer event).

Process Autoscaling Compatible

Can be used in autoscaled processes.

Event Consumer Filter Conditions Compatible

Can be used in filter conditions.

Event Consumer Event Handlers Compatible

Can be used in event handler expressions.

Feedback