Tags in Tines

Tags are only available in text mode. You can nest tags inside each other. There must always be a corresponding end tag for each tag.

if/elseif/else/endif 

These tags all work together to allow you to conditionally evaluate sections in text mode.

At its simplest, you can have an if and endif pair:

If this is run with a user named Alice, it will output Hi Alice, but if the user has no name it will just output Hi.

You can also add an else block to act as a catch-all:

Now if the user has no name it will output Hi there.

Finally, you can add more conditions using elseif:

You can add as many additional conditions with elseif as you like.

As mentioned above, Formulas does not coerce types, with all but NULL & FALSE being truthy. To check if a value is blank simply write the following:

for/endfor 

The for tag allows you to repeat the same block of code multiple times for each item in an array.

This will output User names: followed by the names of all the users in the array users.

Within a for tag, there is a special FORLOOP variable available with the following properties:

  • FORLOOP.index0: The zero based index of the current loop iteration. That is the first time through the loop this will be 0, the second time 1 and so on.

  • FORLOOP.index: The one based index of the current loop iteration. That is the first time through the loop this will be 1, the second time 2 and so on.

  • FORLOOP.first: This will be true the first time through the loop.

  • FORLOOP.last: This will be true the last time through the loop.

For example, if we wanted to output a comma between every name we could do something like this:

Was this helpful?