Skip to main content
Skip table of contents

Loop Status

A Loop status value can provide information of a loop in progress. Its primary use is in condition expressions within a loop.

Related commands

  • forEach
    This command generates Loop status values when its varStatus attribute is defined.

  • repeat
    This content command generates Loop status values when its repeat-var-status secondary attribute is defined.  

Methods

getCount()

Resolves into a Number telling the number of the current iteration within this loop. During the first iteration the value is 1.

For example, the expression ${loopStatus.getCount() == 1} resolves into true only on the loop's first round.

Using the shorthand form the expression becomes ${loopStatus.count == 1}.

getIndex()

Resolves into a Number telling the index of the current iteration within this loop. During the first iteration the value is 0.

For example, the expression ${loopStatus.getIndex() == 0} resolves into true only on the loop's first round.

Using the shorthand form the expression becomes ${loopStatus.index == 0}.

isFirst()

Resolves into a Boolean telling whether the current iteration is the first iteration (true) of the loop or not (false).

For example, the expression ${!loopStatus.isFirst()} resolves into true on all iterations except the first.

Using the shorthand form the expression becomes ${!loopStatus.first}.

isLast()

Resolves into a Boolean telling whether the current iteration is the last iteration (true) of the loop or not (false).

For example, the expression ${loopStatus.isLast()} resolves into true on the loop's last round.

Using the shorthand form the expression becomes ${loopStatus.last}.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.