You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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


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


  • No labels