map

This block is part of the array group and was last modified in core v13.0.7.

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.

map v13.0.7

Creates a new array with the results of the provided function on every element in the array.

In pins 2
  • Array required
    array

    The input array to be processed.

  • Concurrency
    number

    How many times this function should be executed in parallel. • Min: 0 • Max: 1000

    Default 10

Out pins 3
  • Array
    array
  • Iterator
    execute_function

    The function to be applied to each element in the array.

  • error v13.0.7
    value

    Error message in case of failure.

Runs the wired callback once per item (callback pins index and value) and collects each return value into a new array in input order; an item whose callback fails or returns nothing yields null at that position. Iterations can run in parallel (concurrency pin, default 10) but output order always matches input order. Non-array input outputs [] plus error NOT_AN_ARRAY; with NO callback wired the input array passes through unchanged.

map

An array built with with values flows into map. The function out pin wires to an execute block: that small chain runs once per item and receives index and value. Here the value goes through convert to uppercase and the chain wires its answer back to the execute block, so map outputs a new array with every name uppercased.

Studio canvas example for the map block: uppercasing every item with map.

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.
  • filter empty: this block feeds into it. Returns an array of all non-empty items. Empty is defined as: null or undefined.
  • search: feeds into this block. searches in the given storage based on a query.
  • new object: this block feeds into it. Builds a new object filled with the given fields.
  • get multiple documents (cached): feeds into this block. Get multiple documents from the given storage using the hot document cache. Fetches each document individually. Skips documents that do not exist or are removed.
  • reply in JSON: this block feeds into it. Reply to any httpconnection as JSON body.

Used in these guides

These documentation pages use or explain this block:

Version history

Introduced in v13.0.7.


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