Skip to main content

List Remove

Category: Lists List Remove block screenshot

Removes one element from an existing list variable. Use `where` to remove the `FIRST`, `LAST`, a zero-based `INDEX`, a zero-based `FROM_END` position, or a `RANDOM` element. If `where` is omitted, the block defaults to `LAST`. The `index` input is only used for `INDEX` and `FROM_END`. If `storeRemovedIn` is set, the removed value is written into that variable. Removing from an empty list or using an out-of-range index throws an error.

Inputs

InputRequiredValue KindTypesEnum Values
nameyesstring
wherenoexpressionenum-stringFIRST, LAST, INDEX, FROM_END, RANDOM
indexnoexpressionnumber
storeRemovedInnovariable-name

Notes

  • Mutating statement for removing one value from a list variable.
  • where modes:
    • FIRST: remove first element.
    • LAST: remove last element.
    • INDEX: remove element at zero-based index from start.
    • FROM_END: remove element at zero-based position from end (index=0 means last element).
    • RANDOM: remove a random element.
  • If where is omitted, behavior defaults to LAST.
  • index is only used for INDEX and FROM_END.
  • If storeRemovedIn is set, the removed value is written into that variable.

Examples

Traverse Nested Sequences With Deduped Worklist

Traverses the active sequence and nested sequences through a pending/seen worklist so nested sequence refs are not processed twice.

kind: Pattern · format: runtime-dsl · validation: MCP fixture

Topics: sequence traversal, nested sequences, clip iteration, lists

Source: patterns/ex-sequence-traverse-nested-deduped.json

Download JSON