Blocks Deprecated
Deprecated: use the web blocks for new pages This block belongs to state pages and UI components. Existing pages keep running, but new pages should use the web blocks. See Web Pages and the migration guide.

div foreach

This block is part of the state ui group and was last modified in core v13.0.6.

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.

div foreach v13.0.1 Updated v13.0.6

Serves as a dynamic container, generating an unique div for each element in the specified array.

In pins 5
  • array array required

    This array is the source of data for generating the individual div elements. • Hidden when other fields are filled

  • state key value required v13.0.4

    This state key is the source of data for generating the individual div elements. • Hidden when other fields are filled

  • class uiclass

    Assigns a CSS class to the element. • Hidden when unused

  • style uistyle

    Applies inline CSS style to the element • Hidden when unused

  • attributes uiattributes

    Adds custom attributes to the element. • Hidden when unused

Out pins 2
  • state state

    Returns the element to the frontend state.

  • iterator execute_function

    Allows you to execute a custom function to determine the content of each div element.

A typical wiring for div foreach: with values feeds the array pin; value feeds the state pin; the function out pin wires to an execute block.

Studio canvas example for the div foreach block: typical wiring for div foreach.

Used in these guides

These documentation pages use or explain this block:

Version history

Introduced in v13.0.1.

Last modified in v13.0.6.

v13.0.4 This block or one of its pins was updated in v13.0.4, click here to see the release notes.
Back to state ui Return to the main group to view all sub-groups Back to state elements Return to the group to view all blocks within this group