Script Helper
QVS-004 Free Test before use
Follow-up question shown when a parent answer is 'True'
Show a follow-up only after the person answers Yes to a prior question.
Questions › Set VisibleQuestionSetVisibleBeginner
Test before use. This script hasn't been tested by Catalyst Workflow yet. Run it in a non-production case first.
JScript.NET
1// QuestionSetVisible — Show follow-up when TobaccoUse = Yes2var p = Event.CurrentPerson;3Event.Value = false;4if (p != null) {5 var parent = Event.GetAnswer(p.PersonID, 'TobaccoUse'); // CHANGE: parent question code6 Event.Value = (parent != null && parent == 'True');7}Highlighted lines are marked CHANGE — swap in your own values before using.
How it works
Yes/No answers come back as the strings 'True'/'False'; null means unanswered, so the follow-up stays hidden.
Values to change
- Parent question code
Cautions
- Comparing to 'Yes' or to boolean true will never match.