filter
This block is part of the array group and was last modified in core v10.4.28.
Type Selection Required
This block requires you to select the data type you want to work with. You must manually select the type using the type selector modal. To access the modal, click the white button on the block.
filter v10.4.28 Returns an array for each item that returns true on the executed function.
- Array required
arrayThe array to be filtered.
- Array
arrayAll items the executed function returned
trueon. - Iterator
execute_function
Runs the iterator callback per item (index, value, value_current_array holds the kept-so-far items) and KEEPS items whose callback return is truthy by JS rules: any non-false, non-zero, non-empty value passes, not only boolean true. Items whose callback errors are dropped. With no callback wired the input array passes through UNCHANGED; a missing input yields an empty array.
An array built with with values flows into filter. The function out pin wires to an execute block whose chain runs once per item: the item value is compared against a target with == and the resulting condition is wired back as the answer. Items whose answer is true stay in the output array, the rest is dropped.
Commonly used with
In production blueprints, this block is most often wired together with:
- execute: this block feeds into it. Executes the given funcion and waits for it to be executed.
- search: feeds into this block. searches in the given storage based on a query.
- set fields: this block feeds into it. Generates an array of mutations based on the given filled fields.
- get fields: feeds into this block. Gets the selected fields from the given object.
- get meta guids: this block feeds into it. Returns an array of values with _meta.guid's of each object in the given array.
- return: this block feeds into it. Returns the added custom pins as data-pins on the function execute.
Version history
Introduced in v10.4.28.
Back to
array Return to the main group to view all sub-groups Back to array Return to the group to view all blocks within this group 