Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel

TSL FOREACH

statement [[[FOREACH entity]]] [[[/FOREACH]]]

statement


Use this statement to repeat a text for each instance of an entity.


Syntax

Code Block
[[[FOREACH entity]]] message [[[/FOREACH]]]


Inputs

  • entity: is an entity name

  • message: is a TSL message, so it can contain plain text and other TSL conditions


Example

Suppose you want to create an overview of all registered users. Then you could create the following message:

Code Block
[[[FOREACH user]]]Name: [[[user.last_name]]], [[[user.first_name]]][[[/FOREACH]]]


If you have three registered users: John Doe, Jane Doe and Mr X your user list would look like this: Name: Doe, John Name: Doe, Jane Name: X, Mr

Back to top

...