filter empty

This block is part of the array group and was last modified in core v10.4.28.

filter empty v10.4.28

Returns an array of all non-empty items. Empty is defined as: null or undefined.

In pins 2
  • Array required
    array
  • filter string
    condition

    If true given, we will filter empty strings too. • Hidden when unused

Out pins 1
  • Array
    array

    Array of items that are not empty.

Removes ONLY null items from the array; when filter_empty_string is true it also removes empty strings. Zero, false, empty objects, and empty arrays are NOT removed. Order of the remaining items is preserved.

A typical wiring for filter empty: map feeds the array pin; true feeds the filter_empty_string pin; the array out pin feeds reply in JSON.

Studio canvas example for the filter empty block: typical wiring for filter empty.

Commonly used with

In production blueprints, this block is most often wired together with:

  • map: feeds into this block. Creates a new array with the results of the provided function on every element in the array.
  • reply in JSON: this block feeds into it. Reply to any httpconnection as JSON body.
  • filter types: feeds into this block. Returns an array of all items matching the selected type.
  • with objects: feeds into this block. Returns an array of objects.
  • true: feeds into this block. Gives the condition true hard-coded.
  • set fields: this block feeds into it. Generates an array of mutations based on the given filled fields.

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