---
title: "flat map · RUAL Documentation"
description: "Executes the provided function on every element in the array and returns as a flat array."
canonical: https://docs.rual.nl/block-types/array/array_flat_map
language: en
---

# flat map

This block is part of the [`array`](https://docs.rual.nl/block-types/array) group and was last modified in core [`v10.4.28`](https://docs.rual.nl/core-versions/100428).

### 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.

Executes the provided function on every element in the array and returns as a flat array.

- Array required `array` The input array to be processed.

- Flat Array `array` The resulting flat array after applying the function.

- Iterator `execute_function` The function to be applied to each element in the array.

Runs the iterator callback per item (index, value) and appends the value of EVERY return pin of the callback, in pin order, so one call can contribute several elements to the output. Null return values and failed calls contribute nothing. With no callback wired the input array passes through UNCHANGED; a missing or non-array input yields an empty array.

A typical wiring for [flat map](https://docs.rual.nl/block-types/array/array_flat_map): the function out pin wires to an [execute](https://docs.rual.nl/block-types/function%20execution/function_custom_execute_from_trigger) block.

![Studio canvas example for the flat map block: typical wiring for flat map.](https://docs.rual.nl/canvas-examples/array_flat_map.png)

### Version history

Introduced in [`v10.4.28`](https://docs.rual.nl/core-versions/100428).
