You are viewing the documentation for Blueriq 16. Documentation for other versions is available in our documentation directory.
TSL FOREACH statement
Use this statement to repeat a text for each instance of an entity.
Syntax
[[[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:
[[[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
Overview
Content Tools