Exclude Nones

This function block removes None entries from a provided list. Use it when you need a clean list without empty placeholders before further processing or exporting.

πŸ“₯ Inputs

Data List β€” Input socket that accepts a list of values. Elements may be of any type and some may be None.

πŸ“€ Outputs

Filtered Data List β€” Output socket that returns the same list order but with all None elements removed.

πŸ•ΉοΈ Controls

This block has no user-adjustable controls. It runs automatically when the input list is provided.

🎯 Features

  • Simple and fast removal of None values while preserving original order.

  • Works with mixed-type lists (numbers, strings, images, dictionaries, etc.).

  • Useful to sanitize batch or list outputs before downstream processing or exporting.

βš™οΈ Running mechanism

On evaluation the block reads the value from the Data List input, filters out any elements that are None, and emits the cleaned list to Filtered Data List. If the input is empty or contains only None values, the output will be an empty list.

πŸ’‘ Tips and Tricks

  • Combine with Replace None when you prefer substituting default values instead of removing items.

  • Use Get Element or List Operations after this block to safely access or manipulate list items without checking for None.

  • Use Is None before this block to branch logic (for example, skip processing when many items are None).

  • For batch workflows, pair with Batch Processing, Debatch, or Batch Concatenation to handle list/batch inputs and outputs cleanly.

  • Store cleaned results with Data Memory if you need to freeze the filtered list until an update is requested.

  • Prepare data for export by piping the output into Data to JSON, CSV Export, or Image Logger (when list contains images).

  • Use Debug Input to inspect incoming lists if results look unexpected.

πŸ› οΈ Troubleshooting

  • If the output still contains None, confirm that the value at Data List is truly a list and not a different data type.

  • If nothing appears on the output, check upstream blocks with Debug Input to ensure they are producing the expected list.

Last updated

Was this helpful?