getCycleCount( )

Get the current cycle instance number per subject within the input branch of the current subject. For example, you can get the count of existing cycles.

Syntax

getCycleCount(branchShortName)

Parameters

branchShortName

The short name for the branch you want to count.

Return value

Returns the subject branch cycle instance number or -1 if the subject is not provided on the branch.

Note:

If the branch name is changed between study versions, use the isStudyVersion( ) function to get the appropriate name.

Example 3-99 If the Branch01 has at least 1 started cycle, set the value of a drop-down to true

// get the current cycle count of branch 'Branch01'
var cycleCount = getCycleCount('Branch01');
  
// if at least 1 cycle has been started in Branch01, set value to true
if (cycleCount > 1) {
  return setChoiceLabel("TRUE");
} else {
  return setChoiceLabel("FALSE");
}