List Operations

This function block provides a collection of common list operations (create, modify, query and combine lists). Selecting a method updates the visible sockets so you only see the inputs and outputs required for that operation. It is designed for non-programmers and works like a small toolbox for list manipulation inside your flow.

πŸ“₯ Inputs

The block adapts its sockets depending on the selected method. Common input socket names you may see:

  • List - Generic list input (many methods accept this).

  • Element - Single element to insert or remove.

  • Index - Position index for get/insert/pop/set operations.

  • List1 and List2 - Two lists to combine (for extend).

  • Data List and Condition List - Inputs for filtering by boolean mask.

  • List (String) - A comma-delimited string to create a list from text.

  • Start and End - Indexes for slicing.

  • List(s) - A list of lists to pair-merge.

(Available inputs will change automatically when you pick a different operation.)

πŸ“€ Outputs

Outputs depend on the chosen method. Typical outputs include:

  • List - Resulting list after an operation.

  • Filtered List - Result after applying a filter.

  • Size - Length of the list.

  • Element - Single element returned by get/min/max.

  • Index - Index of a found element.

  • Sliced List / Sorted List / Reversed List - Variants for transformation methods.

  • List (paired) - Combined list when using pair operation.

The block will show the correct output sockets for the operation you selected.

πŸ•ΉοΈ Controls

  • Select a method - Dropdown to choose the list operation (examples below).

  • Info (visible when present) - Short help text explaining requirements for the selected method.

Common selectable methods in the dropdown:

  • append

  • extend

  • insert

  • remove

  • pop

  • filter

  • filter_inverse

  • len

  • min

  • max

  • index

  • sort

  • reverse

  • sum

  • get

  • slice

  • create

  • set

  • pair

🎯 Features

  • Dynamic sockets: inputs and outputs update automatically to match the selected operation, keeping the interface simple.

  • Clear guidance: when an operation needs specific input formats (for example a boolean mask for filtering), an explanatory text appears.

  • Safe operations: common user errors (like out-of-range indexes or missing elements) produce readable error messages to guide corrections.

  • String-to-list creation: create lists from comma-separated text without writing code.

πŸ“ Usage Instructions

  1. Choose the operation with Select a method.

  2. Connect the required input sockets shown (the block will display only needed sockets).

  3. Provide values or connect other blocks to supply inputs.

  4. Read outputs from the shown output sockets. Use them further in your flow.

Examples:

  • To add an item, pick append and provide List and Element. Output will be the updated List.

  • To create a list from text, pick create and feed a comma-separated string to List (String).

  • To filter a data list, pick filter and supply Data List plus a Condition List of booleans.

πŸ“Š Evaluation

When evaluated, the block performs the chosen list operation and returns the outputs corresponding to that operation. If inputs are invalid (for example a bad index or mismatched sizes for filtering), the block displays an informative error and returns a safe value where applicable.

πŸ’‘ Tips and Tricks

  • Use Create together with String Input to build lists from text fields (handy for quick test data).

  • Clean up results with Exclude Nones after operations that may produce None values.

  • Use Get Element to safely extract an element from the list for other processing blocks.

  • For batch workflows, combine with Batch Processing, Debatch or Get Batch Size to handle many lists or list-of-lists efficiently.

  • Use Filter or Filter Inverse with a boolean mask produced by other analysis blocks (for instance from measurement or condition checks).

  • When you need to save or log list results, connect outputs to Data to JSON, CSV Export or Image Logger (for cases where list data corresponds to image capture events).

  • Use Debug Input or Show Image (if your list items are images) to inspect intermediate outputs during setup.

  • Use Pair to horizontally merge multiple equal-sized lists (useful to build tabular data).

Suggested combinations with other function blocks:

  • If you build a list of detections, use Object Detection, then collect and manage them using List Operations and store results via CSV Export.

  • Create lists with Create from text, filter with outputs of logical checks like Equals / Greater, then inspect with Debug Input.

  • When working with image batches (lists of images), use Batch Processing + Image Resize on each item, and collect results with List Operations methods like append or extend.

πŸ› οΈ Troubleshooting

  • Operation mismatch: If sockets seem missing, check Select a method β€” sockets update to match the selected operation.

  • Out of range index: For operations using an Index provide a value between 0 and the list size minus one.

  • Filter size mismatch: For filter and filter_inverse ensure Data List and Condition List are lists of equal length (the block will report mismatches).

  • Non-list input: Several methods expect a list. If you receive errors, verify the upstream output is actually a list or use Create to build one.

If you need help deciding which method to use, pick Select a method and read the on-screen Info text that appears for operations with special requirements.

Last updated

Was this helpful?