Iterator feature overview

Updated at:

An iterator is a list generator. In the block editor, you can create a unit template by adding and grouping one or more widgets. The iterator then uses data to generate a list. The number of list items is determined by the length of the array in the iterator's data. This topic describes the features and operations of the iterator.

An iterator is a list generator. Each item in the list is called an iteration unit. The widget types and layout in the unit are the same as the unit template. The data for the widgets in the unit can be driven by their own data source or obtained from the iterator.

Important The immediate child layer of an iterator can only be an iteration unit, not a regular widget. Regular widgets are contained within the iteration unit.

Iterator operations

Operation Description
Generate an iterator
  1. In the block editor, click one or more widgets in the Widget list to add them to the canvas. Group the widgets as needed.
  2. Select one or more widgets and groups. Right-click the selection and choose Generate iterator. The selected widgets are automatically wrapped inside the iterator to create an iteration unit.
Add a widget to an iterator In the layer panel of the block editor, select a widget that is not inside an iterator. Drag the widget's layer into the iterator.
Remove a widget from an iterator In the layer panel of the block editor, select a widget that is inside an iterator. Drag the widget's layer to a position outside the iterator.
Get data from an iterator The data response for an iterator must be a complex array. Each item in the array can be passed to child widgets. A widget inside an iterator retrieves its data item from the nearest parent iterator. The data then passes through the widget's filter to produce the final response.

To retrieve data from an iterator for a widget:

  1. Select a widget in the iterator. Open the Data Source Configuration panel on the right.
  2. In the Data Source Configuration panel, click the Data source type drop-down list and select Fetch from iterator.
Rename an iterator In the layer panel of the block editor, double-click the iterator to rename it.