Example of Activating Journey Tasks Based on Input to a Questionnaire
Let’s take a look at how you can activate a dependent task based on the response provided by the user to a specific question in a questionnaire.
This image illustrates the scenario when a task is activated based on the user's response to a specific question in a questionnaire.
![Activation of task based on response to questionnaire](images/per-activate-task-questionnaire.png)
Define a Value Set
To retrieve the response to a question in a questionnaire, you need to create a value set. This sample value set query retrieves the response to the Provide the reason why you are leaving this organization question in the Exit Survey questionnaire.
INPUTS ARE ALLOCATED_CHECKLIST_ID(number)
DEFAULT FOR L_ATTR IS 'C'
ELIGIBLE = 'N'
ALLOCATED_CHECKLIST_ID_STR = TO_CHAR(ALLOCATED_CHECKLIST_ID)
QUERY = 'XXX'
QUERY = '|=AllocatedChecklistId='''||ALLOCATED_CHECKLIST_ID_STR||''''
L_ATTR = GET_VALUE_SET('EXIT_REASON',QUERY)
IF L_ATTR = 'E' THEN
(
ELIGIBLE = 'Y'
)
ELSE
(
ELIGIBLE = 'N'
)
RETURN ELIGIBLE
INPUTS ARE ALLOCATED_CHECKLIST_ID(number)
DEFAULT FOR L_ATTR IS 'E'
ELIGIBLE = 'N'
ALLOCATED_CHECKLIST_ID_STR = TO_CHAR(ALLOCATED_CHECKLIST_ID)
QUERY = 'XXX'
QUERY = '|=AllocatedChecklistId='''||ALLOCATED_CHECKLIST_ID_STR||''''
L_ATTR = GET_VALUE_SET('EXIT_REASON',QUERY)
IF L_ATTR = 'C' THEN
(
ELIGIBLE = 'Y'
)
ELSE
(
ELIGIBLE = 'N'
)
RETURN ELIGIBLE