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 example assumes you have set up a questionnaire task that includes filling up a predefined exit survey at the time of offboarding. One of the questions in the questionnaire asks users to provide the reason for leaving the organization. If the response is E (Education), you want the condition to activate a task where upload their education course acceptance letter and if the response is C (Compensation), you want the condition to activate the task that records their expected compensation.

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

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.

  1. Click + to create a value set.
  2. In the Create Value Set page, enter these values:
    Field Value
    Value Set Code EXIT_REASON
    Description Value set to retrieve question response.
    Module Search and select Checklist Templates
    Validation Type Table
    Value Data Type Character
  3. In the FROM Clause field, enter the following syntax:
    fusion.per_allocated_checklists pac, fusion.per_allocated_tasks pat,
    fusion.hrq_qstnr_participants hqp,
    fusion.hrq_qstnr_responses hqr,
    fusion.hrq_qstn_responses hqsr,
    fusion.hrq_qstnr_questions hqq,
    fusion.hrq_qstnr_sections_b hqs
  4. In Value Column Name, enter hqsr.answer_text.
  5. In ID Column Name, enter hqsr.answer_text.
  6. In WHERE Clause, enter this syntax:
    pac.allocated_checklist_id = pat.allocated_checklist_id
    AND hqp.participant_id = pat.allocated_task_id
    AND hqr.qstnr_participant_id = hqp.qstnr_participant_id
    AND pat.questionnaire_id = hqp.questionnaire_id
    AND hqsr.qstnr_response_id = hqr.qstnr_response_id
    AND hqs.questionnaire_id = 2100 – This is the Questionnaire ID for ‘Exit Survey’ questionnaire.
     AND hqs.qstnr_section_id = hqq.qstnr_section_id
     AND hqq.question_id = 5920 – This is the Question ID for ‘Provide the reason why you are leaving this organization.’ question.
     AND hqq.qstnr_question_id = hqsr.qstnr_question_id
     AND PAC.ALLOCATED_CHECKLIST_ID = :{PARAMETER.AllocatedChecklistId}

    This example uses the seeded Exit Survey questionnaire and the specific question Provide the reason why you are leaving this organization question in the questionnaire. You need to replace the questionnaire_id and question_id in the query provided in step 6 for the question that should be evaluated to trigger dependent tasks. These values are visible on the Questionnaires configuration page as Questionnaire Code and Question Code respectively. This query works only for a text field in a questionnaire.

This sample formula checks the response to a specific question 'Provide the reason why you are leaving this organization' in the seeded Exit Survey questionnaire to activate other tasks. If the response to that question is E, it activates the task where they can upload their education course acceptance letter.
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
This sample formula checks the response to a specific question 'Provide the reason why you are leaving this organization' in the seeded Exit Survey questionnaire to activate other tasks. If the response to that question is C, it activates the task where they can provide their expected compensation.
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