for


When using array parameters, for tags allow users the ability to loop through a collection.


Syntax


{% for <Item> in <Array>[ Options] %}

<Template Block>

{% endfor %}



Arguments

Array - An array or name of the input parameter array to use


Item - Used within the template block for the current element within the Array. Within a loop, two methods of specifying properties of an array are available. If the property name contains no whitespace, users may choose either method. If the property name does contain whitespace, then users must use the second method.



<Item>.<PropertyName>




<Item>['<Property Name>']



Options - Influence the behavior of the for loop. There are three optional parameters:

  limit: <Integer Value> - Restricts the number of elements that will be looped through

  offset: <Integer Value> - Allows users to start looping at the nth element

  reversed - Loops through the collection from last to first


Helper Tags

Within a for template block, there are handful of optional tags available:

  break

  continue

  else


Helper Variables

Within a for template block, there are handful of optional arguments available:

  forloop.length - Returns the length of the entire loop

  forloop.index - Returns the index value of the current element [1, ..., n]

  forloop.index0 - Returns the zero-based index value of the current element [0, ..., n]

  forloop.rindex - Returns the number of elements left to iterate through [1, ..., n]

  forloop.rindex0 - Returns the zero-based number of elements left to iterate through [0, ..., n]

  forloop.first - Returns a boolean value as to whether this is the first element within the loop

  forloop.last - Returns a boolean value as to whether this is the last element within the loop


Example:

Input


{% for error in InputParameters %}

Source - {{ error.Source }}

Time - {{ error.Time }}

Details - {{ error['Error Details'] }}


{% endfor %}



Output


Source - Error 1

Time - Time 1

Details - Details 1


Source - Error 2

Time - Time 2

Details - Details 2


Source - Error 3

Time - Time 3

Details - Details 3