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
Parameter | Required/Optional | Description |
---|---|---|
branchShortName |
Required |
The short ID for the branch you are querying for. |
Return value
Number that indicates the branch cycle:
- A positive number refers to the current cycle number.
- -1 if the subject is not on the given branch.
Usage tips
If the branch name is changed between study versions, use the isStudyVersion( ) function to get the appropriate name.
Examples
Example 3-100 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");
}
Parent topic: Multiple visit schedules and cycle visit functions