Skip to main content

Iterator

This node steps through an array one item at a time.

The Iterator node maintains a cursor position in a list and advances it on command.

The Iterator node holds a reference to an array and an internal index. Every time the Next signal is triggered, it advances the index and outputs the next item. It allows for manual, step-by-step processing of a list.

Inputs

Input

DataDescription
ArrayThe array to iterate over.

Actions

SignalDescription
NextAdvances to the next item and outputs it.
ResetResets the index to the beginning (before the first item).

Outputs

Output

DataDescription
ValueThe current item.

Events

SignalDescription
DoneTriggered each time Next successfully advances to a new item.

Usage

Use this for slideshows, wizards, or processing items one by one with user interaction.

Example Use Cases

  1. Image Carousel:
    • Connect list of Image URLs to Array.
    • Connect "Next Button" to Next.
    • Connect Value to an Image node.
  2. Quiz: Show questions one by one.
  3. Tutorial: Step through instructions.

Detailed Behavior

  1. Start State: Initially, the index is -1 (no item selected). The first Next moves to index 0.
  2. End of List: If Next is triggered when at the last item, the index does not advance, and Done is not triggered (indicating end of list).
  3. Reset: Sets index back to -1 and Value to null.

Troubleshooting

  • Stops Working: If you reach the end of the list, you must Reset to start over.