Lists
Create lists, read items, add and remove items, sort, and combine lists.
List length
Returns the number of items in a list.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | List to measure. |
Outputs
| Name | Type | Details |
|---|---|---|
| Length | Whole number | The number of items. |
Item at index
Returns the item at a given index (counted from 0), or empty if out of range.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The list to access. |
| Position (starting at 0) | Whole number | Yes | Position of the item, counted from 0. Negative values count from the end. |
Outputs
| Name | Type | Details |
|---|---|---|
| Value | Item | The item at that index. May be empty. |
First item
Returns the first item of the list, or empty if the list is empty.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The list to read. |
Outputs
| Name | Type | Details |
|---|---|---|
| Value | Item | The first item, or empty. May be empty. |
Last item
Returns the last item of the list, or empty if the list is empty.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The list to read. |
Outputs
| Name | Type | Details |
|---|---|---|
| Value | Item | The last item, or empty. May be empty. |
List contains
Checks whether a list contains a value.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The list to search. |
| Needle | Item | Yes | The value to look for. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Yes/No | True if the value is present. |
Add item to list
Hands back a new list with the value added at the end and leaves the list you gave it unchanged, so use the result in the next step. To collect items across several steps, or inside a loop, use "Create list builder" and "List builder: add item" instead.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The original list. It is not changed. |
| Value | Item | Yes | The value to append. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | List of Item | The new list, with the value on the end. |
Remove from list
Hands back a new list with all occurrences of a value removed and leaves the list you gave it unchanged, so use the result in the next step.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The original list. It is not changed. |
| Value | Item | Yes | The value to remove. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | List of Item | The new list, without that value. |
Join list
Joins a list of texts into one text with a separator.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Text | Yes | List of texts. |
| Separator | Text | Yes | Text inserted between items. Default: , . |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | Text | The joined text. |
List from text
Splits a text into a list using a separator. Leave the separator empty to split into individual characters.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| Text | Text | Yes | The text to split. |
| Separator | Text | No | Optional separator. Leave empty to split the text into individual characters. Default: ``. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | List of Text | The resulting list. |
Number list from text (whole numbers)
Splits a text into a list of whole numbers, so the numbers can be compared and calculated with directly. Spaces around each value are ignored, empty entries are skipped, and a value that is not a whole number stops the action with an error.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| Text | Text | Yes | The text to split, for example "1, 3, 5, 7". |
| Separator | Text | No | What separates the numbers. Defaults to a comma. Default: ,. |
Outputs
| Name | Type | Details |
|---|---|---|
| Numbers | List of Whole number | The list of whole numbers. |
Number list from text (decimals)
Splits a text into a list of numbers that may have decimals. Spaces around each value are ignored, empty entries are skipped, and a value that is not a number stops the action with an error.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| Text | Text | Yes | The text to split, for example "0.5, 1.5, 2". |
| Separator | Text | No | What separates the numbers. Defaults to a comma. Default: ,. |
Outputs
| Name | Type | Details |
|---|---|---|
| Numbers | List of Decimal number | The list of numbers. |
Random item from list
Picks a random item from a list.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | Non-empty list. Minimum items: 1. |
Outputs
| Name | Type | Details |
|---|---|---|
| Value | Item | A random item. May be empty. |
Shuffle list
Returns a new list with the items in random order. The list you gave it is left unchanged.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The list to shuffle. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | List of Item | The shuffled list. |
Sort list (ascending)
Returns a new list sorted in ascending order. The list you gave it is left unchanged.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The list to sort. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | List of Item | The sorted list. |
Sort list (descending)
Returns a new list sorted in descending order. The list you gave it is left unchanged.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The list to sort. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | List of Item | The sorted list. |
Reverse list
Returns a new list with the items in reverse order. The list you gave it is left unchanged.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The list to reverse. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | List of Item | The reversed list. |
Unique list
Returns a new list with duplicate items removed, keeping the first occurrence of each. The list you gave it is left unchanged.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The list to deduplicate. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | List of Item | The list without duplicates. |
Combine lists
Merges two lists into one new list (the first list followed by the second).
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| First list | List of Any | Yes | Items placed at the start. |
| Second list | List of Any | Yes | Items appended after the first. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | List of Item | The merged list. |
Items in both lists
Returns a new list with the items present in both lists, duplicates removed, first occurrence kept.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| First list | List of Any | Yes | The first list. |
| Second list | List of Any | Yes | The list to intersect with. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | List of Item | The items present in both lists. |
Items only in the first list
Returns a new list with the items of the first list that are NOT in the second list, duplicates removed, first occurrence kept.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| First list | List of Any | Yes | The list to take items from. |
| Second list | List of Any | Yes | Items to exclude. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | List of Item | The items of the first list that are not in the second. |
Items in only one list
Returns a new list with the items that are in exactly one of the two lists, duplicates removed. Items unique to the first list come first, then items unique to the second.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| First list | List of Any | Yes | The first list. |
| Second list | List of Any | Yes | The second list. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | List of Item | The items present in exactly one of the two lists. |
Slice list
Returns a part of the list from start (inclusive) to end (exclusive), both counted from 0. Negative positions count from the end, so -1 is the last item.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The list to slice. |
| Start | Whole number | Yes | Start position (inclusive), counted from 0. Negative counts from the end. |
| End | Whole number | No | End position (exclusive), counted from 0. Omit to slice to the end. Negative counts from the end. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | List of Item | The extracted part of the list. |
Create list
Builds a list from up to eight values. Values you leave empty are skipped, so the result holds only the items you provide, in order. To collect items across several steps, or inside a loop, use "Create list builder" instead.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| Item 1 | Any | No | First item. |
| Item 2 | Any | No | Second item. |
| Item 3 | Any | No | Third item. |
| Item 4 | Any | No | Fourth item. |
| Item 5 | Any | No | Fifth item. |
| Item 6 | Any | No | Sixth item. |
| Item 7 | Any | No | Seventh item. |
| Item 8 | Any | No | Eighth item. |
Outputs
| Name | Type | Details |
|---|---|---|
| List | List of Any | The list of provided items. |
List index of
Returns the position of the first matching item in the list (counted from 0), or -1 when it is not found.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The list to search. |
| Value | Item | Yes | The value to look for. |
Outputs
| Name | Type | Details |
|---|---|---|
| Index | Whole number | Zero-based position of the first match, or -1 when absent. |
Split list into groups
Splits the list into consecutive groups of the given size. The last group may be smaller. Each group is itself a list.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The list to split. |
| Group size | Whole number | Yes | Maximum number of items per group. Value: 1 to 100000. |
Outputs
| Name | Type | Details |
|---|---|---|
| Groups | List of Any | The list of groups (each group is a list). |
Merge nested lists
Merges nested lists by one level: items that are themselves lists are merged in, other items are kept as they are.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The list whose nested lists are merged. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | List of Any | The list with nested lists merged by one level. |
Sort list by field
Returns a new list sorted by the value found at a field path on each item (for example "member.joined-at"). The list you gave it is left unchanged.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The list to sort. |
| Field to sort by | Text | Yes | Dot-separated field path to sort by (e.g. "value" or "member.username"). Maximum length: 200 characters. |
| Direction | Sort direction | Yes | Sort ascending or descending. Default: Ascending. |
Outputs
| Name | Type | Details |
|---|---|---|
| Result | List of Item | The sorted list. |
Find in list
Finds the first item of a list whose field equals a value, without a loop. IDs and Discord entities compare by their ID, text exactly, and whole numbers by value, also against the same number written as text. Decimal numbers and yes/no values are not matched against text. Check Found, or use If it has a value, before you use the item. To search by a choice field, first use Turn text into a choice.
Inputs
| Name | Type | Required | Details |
|---|---|---|---|
| List | List of Any | Yes | The list to search. |
| Field | Item field | Yes | The field of each item to compare. Maximum length: 64 characters. |
| Value | Any | Yes | The value the field must have. Always set it; use an empty value to find an item whose field is empty. |
Outputs
| Name | Type | Details |
|---|---|---|
| Item | Item | The first matching item. Empty when no item matches. May be empty. |
| Found | Yes/No | Yes when an item matched. |