isSubjectOnBranch( )

Check if a subject has started any visit in a specific branch.

Syntax

isSubjectOnBranch(branchShortName)

Parameters

Parameter Required/Optional Description
branchShortName Required

The short ID for the branch you are querying for.

Return value

Boolean value:
  • True if the branch with the given short name contains any visits for the subject where data has been entered.
  • False if no visits are initialized in that branch for that subject.

Usage tips

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

Examples

Example 3-95 If subject is on Branch01, set value of text box to "Branch1"

var onBranch = isSubjectOnBranch("Branch1");
if (onBranch) {
  return "Branch1 has been started";
} else {
  return "Branch1 NOT started";
}