Create a series of elements from a collection, such as an array.
If you have some sort of a collection of, for example, textual greetings, and you want to use them in something like the Element Queue, or maybe Element Randomizer.
Using the Element Generator, you don't have to manually specify each and every element you want queued or randomized, and instead you can define a collection and what to do with every item in that collection.
Inside an Element Queue or Element Randomizer, place this inside the main flow. Then, specify which collection of items you want to iterate over, and then place an element inside the Element container of this element.
For every item in the collection you've specified, the Element Generator will read whichever element you have given it, while making certain data available inside its child element's context. Refer to the table below for more information on that.
${["Hello", "Hi", "Howdy"]}
Items property, use the expression syntax to get your collection of greetings. For example, ${GREETINGS}Data collection item name, write greetingElement flow for the Element Generator.
Text property, write ${greeting.natural}: ${greeting.value}!
| Field | Description |
|---|---|
value |
The actual value of the current element of the collection being iterated over. |
index |
Programmatic index of the current element, beginning with 0. |
natural |
Index of the current element incremented by one, how humans count. |
first |
Boolean value, true if the element is the first in the collection. False otherwise. |