PALATINELABSDocsENES

Pages

↑↓ to moveEnter to openEsc to close

List package guide

Use List actions to read, change, compare, and reorder typed items.

Version 2.17.1. Installed versions can differ. Examples are illustrative and not tested.

Jump to actions

Packages

Prerequisites

Create the List variables first, with the stated String, Number or Boolean types. No other application, connection or session is needed. A String with JSON text cannot be used as a List or Table. For Table inputs, use a Table variable or a Table literal with the right columns and rows.

You put inYou get back
String, Number, Boolean, List, DictionaryThe same type
DatetimeText, such as 2024-03-15T10:30:00.0000000+00:00
File, Any textString
Record, Table, Credential, WindowDictionary
JSON nullString null

Shared fields

To keep a change, save the output back in the same List variable. To keep the original, save it in a new variable. Save an Any output in Any or a type that fits the value.

List: use a List variable such as $items$, or a JSON list written directly in the step.

Any item: enter text, or select a typed variable such as $value$. Text written directly stays text. For a Number or Boolean, use a variable of that type.

Indexes: items are numbered from 0. The last item is the count minus 1. An empty List has no item index. To add at the end, use the count. Index and size fields use whole numbers, and cut off a fraction toward zero.

Text comparison: difference, common items, duplicates and sorting compare text, so Number 1 can equal String 1. Sorting is by character code, not by number or language. Choices ignore case. Fields for another mode are not used, but all fields that you fill must have valid types and formats. Omitted optional fields keep their defaults, as do blank optional typed fields (not text).

List inputs

IdentifierEditor fieldType; required; defaultUse
sourceListList variableListdefault []requiredList.
inputListSelect listListdefault []requiredList.
itemPositionNumberIndex numberNumberdefault 0optionalExisting-item index.
caseSensitiveCase-sensitive comparisonBooleandefault falseoptionalfalse ignores case; true distinguishes it.

Actions

Add item (listAddItem)

Add an item to a List.

Inputs

IdentifierEditor fieldType; required; defaultUse
listItemItem to be addedAnydefault ""optionalAny item.
itemPositionAdd itemItemPositiondefault ENDoptionalChoose END to append or ANY to insert at positionNumber⁠.
positionNumberpositionNumberNumberdefault 0optionalANY only: insertion index 0 through count.

Uses the shared inputs: sourceList.

Outputs

IdentifierTypeMeaning
sourceListListThe changed List.

Example

Create $items$ with Strings a, b. Set sourceList=$items$, listItem=c, itemPosition=ANY, positionNumber=0. Bind sourceList to $items$.

Expected result

$items$ becomes ["c","a","b"]. An insertion index outside 0..count fails.

Back to actions

Add item to a copy (listAddItemCopy)

Add an item to a copy. The original List does not change.

Inputs

IdentifierEditor fieldType; required; defaultUse
inputListSelect list to copy fromListdefault []requiredList.
itemItem to be addedAnydefault ""optionalAny item.
insertTypeAdd item at positionInsertAtdefault ENDoptionalEND appends; INDEX inserts at itemPosition⁠.
itemPositionEnter item position indexNumberdefault 0optionalINDEX only: insertion index 0 through count.

Outputs

IdentifierTypeMeaning
resultListNew List with the added item.

Example

Create $items$ with Strings a, b. Set inputList=$items$, item=z, insertType=INDEX, itemPosition=0. Bind result to $copy$.

Expected result

$copy$ is ["z","a","b"]; $items$ stays ["a","b"]. Invalid insertion indexes fail.

Back to actions

Assign (listAssign)

Copy a List, with its order and types, to another variable.

Inputs

IdentifierEditor fieldType; required; defaultUse
sourceListSelect the source list variableListdefault []requiredList.

Outputs

IdentifierTypeMeaning
destinationListListAssigned List.

Example

Create $items$ with Strings a, b. Set sourceList=$items$; bind destinationList to $copy$.

Expected result

$copy$ contains ["a","b"]. An empty input produces [].

Back to actions

Append (listAssignToDataTable)

Add the List to a Table as a new column, one item per row.

Inputs

IdentifierEditor fieldType; required; defaultUse
sourceListSelect list variableListdefault []requiredList.
toTableAssign the outcome to data tableTabledefault empty TablerequiredExisting typed Table, including empty Table; JSON String is invalid.
positionSelectedInsert column at indexPositionSelecteddefault lastPositionoptionalfirstPosition inserts before all columns; lastPosition appends; specificPosition uses specificColumnNumber⁠.
specificColumnNumberspecificColumnNumberNumberdefault 0optionalspecificPosition only: column insertion index 0 through column count.

Outputs

IdentifierTypeMeaning
toTableTableNew Table with the inserted column.

Example

Create $items$ as List a, b. Create $grid$ as a Table with one String column A and rows x, y. Set sourceList=$items$, toTable=$grid$, positionSelected=lastPosition; bind toTable to $grid$.

Expected result

Columns are A, Column2; rows are ["x","a"], ["y","b"]. The new column is named Column plus its one-based position. Its type is the common item type, or String for mixed/empty lists. The row count is the larger input count; missing cells become empty Strings. Invalid column indexes fail.

Back to actions

Chunk list (listChunk)

Split a List into smaller Lists of a set size. The item order stays the same.

Inputs

IdentifierEditor fieldType; required; defaultUse
chunkSizeEnter max size of sub listsNumberdefault 1optionalInteger maximum greater than 0⁠; final chunk can be shorter.

Uses the shared inputs: inputList.

Outputs

IdentifierTypeMeaning
resultListTyped List items.

Example

Create $items$ with Strings a, b, c. Set inputList=$items$, chunkSize=2; bind result to $batches$.

Expected result

$batches$ is [["a","b"],["c"]]. Empty input gives []; zero or negative size fails.

Back to actions

Clear (listClear)

Remove all items from a List.

Inputs

Uses the shared inputs: sourceList.

Outputs

IdentifierTypeMeaning
sourceListListEmpty List.

Example

Create $items$ with Strings a, b. Set sourceList=$items$; bind sourceList to $items$.

Expected result

$items$ becomes []. An already empty list remains empty.

Back to actions

List difference (listDifference)

Get the items in the first List that are not in the second.

Inputs

IdentifierEditor fieldType; required; defaultUse
firstListSelect first ListListdefault []requiredFirst List; its order controls the result.
secondListSelect second ListListdefault []requiredSecond comparison List.

Uses the shared inputs: caseSensitive.

Outputs

IdentifierTypeMeaning
resultListThe items not in the second List, with their order and repeated items kept.

Example

Create $first$ with Strings a, B, c, and $second$ with b, d. Set firstList=$first$, secondList=$second$, caseSensitive=false; bind result to $difference$.

Expected result

$difference$ is ["a","c"]. With caseSensitive=true, it is ["a","B","c"]. No unmatched items gives [].

Back to actions

Find common items (listFindCommonItems)

Get the items in the first List that are also in the second.

Inputs

IdentifierEditor fieldType; required; defaultUse
firstListSelect first listListdefault []requiredFirst List; its order controls the result.
secondListSelect second listListdefault []requiredSecond comparison List.

Uses the shared inputs: caseSensitive.

Outputs

IdentifierTypeMeaning
resultListThe items also in the second List, with their order and repeated items kept.

Example

Create $first$ with a, B, c, and $second$ with b, d, all as text. Set firstList=$first$, secondList=$second$, caseSensitive=false; bind result to $common$.

Expected result

$common$ is ["B"]. With caseSensitive=true, it is [].

Back to actions

Get item (listGet)

Read an item by its number. It stays in the List.

Inputs

Uses the shared inputs: sourceList, itemPositionNumber.

Outputs

IdentifierTypeMeaning
resultAnyThe selected item, with its stored type. See the date tip below.

Example

Create $items$ with Strings a, b. Set sourceList=$items$, itemPositionNumber=1; bind result to $item$.

Expected result

$item$ is String b. Index 2 or any index in an empty list fails.

A date comes back as text. Save it in String or Any. To turn it into Datetime again, use Date and time Assign: option=constant, source=$dateText$, formatType=custom, customFormat=yyyy-MM-dd'T'HH:mm:ss.SSSSSSSXXX. For example, 2024-03-15T10:30:00.0000000+00:00 becomes 2024-03-15T10:30:00+00:00.

Back to actions

Join items (listJoinList)

Join the text of the items with a separator.

Inputs

IdentifierEditor fieldType; required; defaultUse
delimiterDelimiterStringdefault ""optionalText inserted between adjacent items. Empty text joins without a separator.

Uses the shared inputs: sourceList.

Outputs

IdentifierTypeMeaning
resultStringJoined String. Structured items contribute their compact JSON text.

Example

Create $items$ with Strings a, b. Set sourceList=$items$, delimiter=-; bind result to $joined$.

Expected result

$joined$ is a-b. Empty input gives an empty String.

Back to actions

Merge list (listMerge)

Join two Lists into one: first List, then second.

Inputs

IdentifierEditor fieldType; required; defaultUse
firstListSelect first listListdefault []requiredFirst List; its order controls the result.
secondListSelect second listListdefault []requiredList.

Outputs

IdentifierTypeMeaning
resultListBoth Lists, with repeated items and stored types kept.

Example

Create $first$ with Strings a, b, and $second$ with text b, c. Set firstList=$first$, secondList=$second$; bind result to $merged$.

Expected result

$merged$ is ["a","b","b","c"]. Two empty inputs give [].

Back to actions

Remove item (listRemove)

Remove an item by its number, and get the removed item.

Inputs

Uses the shared inputs: sourceList, itemPositionNumber.

Outputs

IdentifierTypeMeaning
resultAnyRemoved item with its stored JSON type.
sourceListListShortened List.

Example

Create $items$ with Strings a, b. Set sourceList=$items$, itemPositionNumber=0. Bind result to $removed$ and sourceList to $items$.

Expected result

$removed$ is a; $items$ is ["b"]. Remaining indexes shift left. An invalid index fails.

Back to actions

Remove duplicates (listRemoveDuplicates)

Remove repeated items. The first one stays.

Inputs

Uses the shared inputs: inputList, caseSensitive.

Outputs

IdentifierTypeMeaning
resultListFirst occurrences, in original order.

Example

Create $items$ with Strings b, a, B. Set inputList=$items$, caseSensitive=false; bind result to $unique$.

Expected result

$unique$ is ["b","a"]. With case sensitivity it is ["b","a","B"]. Empty input gives [].

Back to actions

Remove empty/blank Values (listRemoveEmptyValues)

Remove items that are empty or only spaces.

Inputs

Uses the shared inputs: inputList.

Outputs

IdentifierTypeMeaning
resultListA copy, with the nonempty items and their types kept.

Example

Create $items$ with Strings a, an empty String, three spaces, and text b . Set inputList=$items$; bind result to $filtered$.

Expected result

$filtered$ is ["a"," b "]. This action does not change the text it keeps. All blank items gives []; Number 0 and Boolean false are kept.

Back to actions

Reverse list (listReverse)

Make a copy with the item order reversed.

Inputs

Uses the shared inputs: inputList.

Outputs

IdentifierTypeMeaning
resultListReversed copy, last item first.

Example

Create $items$ with Strings a, b, c. Set inputList=$items$; bind result to $reversed$.

Expected result

$reversed$ is ["c","b","a"]. $items$ stays unchanged. Empty input gives [].

Back to actions

Set item (listSet)

Replace an item by its number, and get the previous item.

Inputs

IdentifierEditor fieldType; required; defaultUse
replaceWithReplace withAnydefault ""optionalAny item.

Uses the shared inputs: sourceList, itemPositionNumber.

Outputs

IdentifierTypeMeaning
resultAnyPrevious item with stored JSON type, not the replacement.
sourceListListUpdated List.

Example

Create $items$ with Strings a, b. Set sourceList=$items$, itemPositionNumber=1, replaceWith=z. Bind result to $old$, and sourceList to $items$.

Expected result

$old$ is b; $items$ is ["a","z"]. List length does not change. An invalid index fails.

Back to actions

Shuffle list (listShuffle)

Put a copy of the List in random order.

Inputs

Uses the shared inputs: inputList.

Outputs

IdentifierTypeMeaning
resultListA copy in random order. Every item is kept.

Example

Create $items$ with Strings a, b, b. Set inputList=$items$; bind result to $shuffled$.

Expected result

$shuffled$ has three items: one a and two b values, in an unspecified order. The original order is possible. Empty input gives [].

Back to actions

Size (listSize)

Count all items in a List, also empty and repeated items.

Inputs

Uses the shared inputs: sourceList.

Outputs

IdentifierTypeMeaning
sizeNumberItem count; 0 when empty.

Example

Create $items$ with Strings a, b. Set sourceList=$items$; bind size to $count$.

Expected result

$count$ is Number 2. Empty input gives 0.

Back to actions

Sort list (listSort)

Sort a copy of the List as text, so 10 comes before 2.

Inputs

IdentifierEditor fieldType; required; defaultUse
sortTypeSort orderSortOrderdefault ASCENDINGoptionalASCENDING sorts from low to high character codes. DESCENDING reverses that order.

Uses the shared inputs: inputList, caseSensitive.

Outputs

IdentifierTypeMeaning
resultListA sorted copy. Types are kept. Items with the same text can change places.

Example

Create $numbers$ with Numbers 2, 10, 1. Set inputList=$numbers$, sortType=ASCENDING, caseSensitive=false; bind result to $sorted$.

Expected result

$sorted$ is [1,10,2]. Descending order gives [2,10,1]. Empty input gives [].

Back to actions

Strip list items (listStripItems)

Remove spaces at the start and end of each item. All items become text, also values that were not Strings.

Inputs

IdentifierEditor fieldType; required; defaultUse
inputListSelect listListdefault []requiredList; each item becomes text, including non-Strings.

Outputs

IdentifierTypeMeaning
resultListTrimmed Strings; blank items become empty Strings and remain.

Example

Create $items$ with Strings a , b , and two spaces. Set inputList=$items$; bind result to $trimmed$.

Expected result

$trimmed$ is ["a","b",""]. Empty input gives []; internal spaces are kept.

Back to actions

Conditions

List contains value (listCondition)

Compare the stored text with text, a Number or a Boolean. Different stored types can match.

Inputs

IdentifierEditor fieldType; required; defaultUse
variableList variable(contains value)Listdefault []requiredList.
subtypeTypeSubtypedefault StringoptionalString compares exact text and case. Number reads each item as a number with a decimal point. Boolean compares the lowercase text true or false⁠.
stringValueValueStringdefault ""optionalUsed when subtype=String⁠; enter the exact text to find.
numberValueValueNumberdefault 0optionalUsed when subtype=Number⁠; enter a number or select a Number variable. Unparseable items are skipped.
booleanCompareToValueBooleanCompareTodefault TrueoptionalUsed when subtype=Boolean⁠: True searches for true⁠, False for false⁠, and Variable uses booleanValue⁠.
booleanValueBoolean variableBooleandefault falseoptionalUsed only with Boolean subtype and booleanCompareTo=Variable⁠. Select a Boolean variable or enter true or false⁠.

Outputs

No output fields. Use the condition in a control step: true for a match, otherwise false.

Example

Create $items$ with Strings a, b. Set variable=$items$, subtype=String, stringValue=b. Use this condition on an If step.

Expected result

The evaluation is true. Changing stringValue to B gives false. An empty list gives false.

Back to conditions