Skip to main content

Lists

Create lists, read items, add and remove items, sort, and combine lists.

List length​

Returns the number of items in a list.

Inputs

NameTypeRequiredDetails
ListList of AnyYesList to measure.

Outputs

NameTypeDetails
LengthWhole numberThe number of items.

Item at index​

Returns the item at a given index (counted from 0), or empty if out of range.

Inputs

NameTypeRequiredDetails
ListList of AnyYesThe list to access.
Position (starting at 0)Whole numberYesPosition of the item, counted from 0. Negative values count from the end.

Outputs

NameTypeDetails
ValueItemThe item at that index. May be empty.

First item​

Returns the first item of the list, or empty if the list is empty.

Inputs

NameTypeRequiredDetails
ListList of AnyYesThe list to read.

Outputs

NameTypeDetails
ValueItemThe first item, or empty. May be empty.

Last item​

Returns the last item of the list, or empty if the list is empty.

Inputs

NameTypeRequiredDetails
ListList of AnyYesThe list to read.

Outputs

NameTypeDetails
ValueItemThe last item, or empty. May be empty.

List contains​

Checks whether a list contains a value.

Inputs

NameTypeRequiredDetails
ListList of AnyYesThe list to search.
NeedleItemYesThe value to look for.

Outputs

NameTypeDetails
ResultYes/NoTrue 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

NameTypeRequiredDetails
ListList of AnyYesThe original list. It is not changed.
ValueItemYesThe value to append.

Outputs

NameTypeDetails
ResultList of ItemThe 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

NameTypeRequiredDetails
ListList of AnyYesThe original list. It is not changed.
ValueItemYesThe value to remove.

Outputs

NameTypeDetails
ResultList of ItemThe new list, without that value.

Join list​

Joins a list of texts into one text with a separator.

Inputs

NameTypeRequiredDetails
ListList of TextYesList of texts.
SeparatorTextYesText inserted between items. Default: , .

Outputs

NameTypeDetails
ResultTextThe joined text.

List from text​

Splits a text into a list using a separator. Leave the separator empty to split into individual characters.

Inputs

NameTypeRequiredDetails
TextTextYesThe text to split.
SeparatorTextNoOptional separator. Leave empty to split the text into individual characters. Default: ``.

Outputs

NameTypeDetails
ResultList of TextThe 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

NameTypeRequiredDetails
TextTextYesThe text to split, for example "1, 3, 5, 7".
SeparatorTextNoWhat separates the numbers. Defaults to a comma. Default: ,.

Outputs

NameTypeDetails
NumbersList of Whole numberThe 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

NameTypeRequiredDetails
TextTextYesThe text to split, for example "0.5, 1.5, 2".
SeparatorTextNoWhat separates the numbers. Defaults to a comma. Default: ,.

Outputs

NameTypeDetails
NumbersList of Decimal numberThe list of numbers.

Random item from list​

Picks a random item from a list.

Inputs

NameTypeRequiredDetails
ListList of AnyYesNon-empty list. Minimum items: 1.

Outputs

NameTypeDetails
ValueItemA 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

NameTypeRequiredDetails
ListList of AnyYesThe list to shuffle.

Outputs

NameTypeDetails
ResultList of ItemThe shuffled list.

Sort list (ascending)​

Returns a new list sorted in ascending order. The list you gave it is left unchanged.

Inputs

NameTypeRequiredDetails
ListList of AnyYesThe list to sort.

Outputs

NameTypeDetails
ResultList of ItemThe sorted list.

Sort list (descending)​

Returns a new list sorted in descending order. The list you gave it is left unchanged.

Inputs

NameTypeRequiredDetails
ListList of AnyYesThe list to sort.

Outputs

NameTypeDetails
ResultList of ItemThe sorted list.

Reverse list​

Returns a new list with the items in reverse order. The list you gave it is left unchanged.

Inputs

NameTypeRequiredDetails
ListList of AnyYesThe list to reverse.

Outputs

NameTypeDetails
ResultList of ItemThe 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

NameTypeRequiredDetails
ListList of AnyYesThe list to deduplicate.

Outputs

NameTypeDetails
ResultList of ItemThe list without duplicates.

Combine lists​

Merges two lists into one new list (the first list followed by the second).

Inputs

NameTypeRequiredDetails
First listList of AnyYesItems placed at the start.
Second listList of AnyYesItems appended after the first.

Outputs

NameTypeDetails
ResultList of ItemThe merged list.

Items in both lists​

Returns a new list with the items present in both lists, duplicates removed, first occurrence kept.

Inputs

NameTypeRequiredDetails
First listList of AnyYesThe first list.
Second listList of AnyYesThe list to intersect with.

Outputs

NameTypeDetails
ResultList of ItemThe 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

NameTypeRequiredDetails
First listList of AnyYesThe list to take items from.
Second listList of AnyYesItems to exclude.

Outputs

NameTypeDetails
ResultList of ItemThe 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

NameTypeRequiredDetails
First listList of AnyYesThe first list.
Second listList of AnyYesThe second list.

Outputs

NameTypeDetails
ResultList of ItemThe 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

NameTypeRequiredDetails
ListList of AnyYesThe list to slice.
StartWhole numberYesStart position (inclusive), counted from 0. Negative counts from the end.
EndWhole numberNoEnd position (exclusive), counted from 0. Omit to slice to the end. Negative counts from the end.

Outputs

NameTypeDetails
ResultList of ItemThe 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

NameTypeRequiredDetails
Item 1AnyNoFirst item.
Item 2AnyNoSecond item.
Item 3AnyNoThird item.
Item 4AnyNoFourth item.
Item 5AnyNoFifth item.
Item 6AnyNoSixth item.
Item 7AnyNoSeventh item.
Item 8AnyNoEighth item.

Outputs

NameTypeDetails
ListList of AnyThe 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

NameTypeRequiredDetails
ListList of AnyYesThe list to search.
ValueItemYesThe value to look for.

Outputs

NameTypeDetails
IndexWhole numberZero-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

NameTypeRequiredDetails
ListList of AnyYesThe list to split.
Group sizeWhole numberYesMaximum number of items per group. Value: 1 to 100000.

Outputs

NameTypeDetails
GroupsList of AnyThe 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

NameTypeRequiredDetails
ListList of AnyYesThe list whose nested lists are merged.

Outputs

NameTypeDetails
ResultList of AnyThe 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

NameTypeRequiredDetails
ListList of AnyYesThe list to sort.
Field to sort byTextYesDot-separated field path to sort by (e.g. "value" or "member.username"). Maximum length: 200 characters.
DirectionSort directionYesSort ascending or descending. Default: Ascending.

Outputs

NameTypeDetails
ResultList of ItemThe 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

NameTypeRequiredDetails
ListList of AnyYesThe list to search.
FieldItem fieldYesThe field of each item to compare. Maximum length: 64 characters.
ValueAnyYesThe value the field must have. Always set it; use an empty value to find an item whose field is empty.

Outputs

NameTypeDetails
ItemItemThe first matching item. Empty when no item matches. May be empty.
FoundYes/NoYes when an item matched.
Need more help?
Can't find what you're looking for? Our team is happy to help.