Get Batch Size
This function block returns the number of elements in a provided batch or list. It is useful for flow control, logging, and branching decisions when working with grouped data.
π₯ Inputs
BatchThis input accepts a batch/list of items to measure.Socket: Input
π€ Outputs
SizeNumeric value representing the count of elements in the provided batch.Socket: Output
πΉοΈ Controls
No ControlsThis function block does not expose any interactive widgets.
βοΈ Running mechanism
When this block receives a batch on its input socket it evaluates the collection and outputs the current number of elements on the Size output. Evaluate this block downstream of any process that creates or combines batches to get an immediate numeric count for decision making or logging.
Use helper blocks (see Tips and Tricks) to validate or adjust the batch before feeding it in, so the size measurement is reliable even when upstream data is missing or dynamic.
π― Features
Simple, single-purpose block that provides an immediate numeric size for any batch/list input.
Works as a lightweight flow-control tool to trigger conditional logic based on batch length.
Compatible with generic batch-producing blocks in the flow control and data processing categories.
π Usage
Place this block after any block that outputs a list/batch to obtain the number of items being passed along.
Feed the
Sizeoutput into comparison or logic blocks (for example,Greater,Equals,Logic Input) to branch the scenario based on batch count.Combine with logging or export blocks to record how many items were processed in each run.
π‘ Tips and Tricks
Use with
Batch Processingwhen you are creating batches for memory-efficient processing; connect its batch output toBatchhere to monitor batch sizes.After splitting a batch with
Debatch, reconnect pieces and use this block to verify the size of reassembled lists.Combine with
Get Elementto check a batch length before trying to access an index; this prevents out-of-range access.When merging multiple batches, use
Batch Concatenationfirst, then this block to confirm the resulting size.If the upstream source may provide no data, pair this block with
Is NoneorReplace Noneto ensure stable behavior and avoid unexpected errors.
π οΈ Troubleshooting
If the block reports unexpected sizes, verify that the input is indeed a list/batch type (use debugging or
Debug Inputto inspect content).If the input may be absent, add validation using
Is NoneorReplace Noneso the size measurement remains predictable.
Last updated
Was this helpful?