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, enter this 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

Activate Task Based on Questionnaire having Radio Button or Single Choice List as Response Type

Let's take a look at how you can activate a dependent task based on the response provided by the user to specific questions in a questionnaire. The response type for the questions is radio button or single choice list.

This example assumes you have set up a questionnaire task that includes filling up a predefined onboarding survey at the time of onboarding. These are the response types for the two question types in the example:
  • Radio button
  • Single choice list
For both response types, the approach is the same. The first question in the questionnaire asks users to provide their feedback about feeling welcomed in the organization. This question has a radio button as the response type. The 2 response options are Yes and No. This table shows the response code for the 2 response options.
Question Code Question Text Response Code Description
5860 I am feeling welcome here. 8237 Yes
5860 I am feeling welcome here. 8238 No

The second question in the questionnaire asks users to rate their onboarding experience. This question has a single choice list as the response type. The 2 response options are Excellent, Average, and Bad. This table shows the response code for the 3 response options.

Question Code Question Text Response Code Description
5870 How would you rate your onboarding experience? 8241 Excellent
5870 How would you rate your onboarding experience? 8242 Average
5870 How would you rate your onboarding experience? 8243 Bad

Based on the response to the first question, you can activate a couple of tasks. If the user answers Yes, you can ask them to fill a feedback form on how their first few days have been. If the user answers No, you can ask them to provide suggestions on how the process can be improved, so that they feel more welcomed. To do this, you need to create a value set.

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 question I am feeling welcome here in the Onboarding Survey questionnaire.

  1. Click + to create a value set.
  2. In the Create Value Set page, enter these values:
    Field Value
    Value Set Code FEELING_WELCOME_HERE
    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, enter this 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_list.
  5. In ID Column Name, enter hqsr.answer_list.
  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 = 2000 – This is the Questionnaire ID for ‘Onboarding Survey’ questionnaire.
     AND hqs.qstnr_section_id = hqq.qstnr_section_id
     AND hqq.question_id = 5860 – This is the Question ID for ‘I am feeling welcome here.’ question.
     AND hqq.qstnr_question_id = hqsr.qstnr_question_id
     AND PAC.ALLOCATED_CHECKLIST_ID = :{PARAMETER.AllocatedChecklistId}

    This example uses the seeded Onboarding Survey questionnaire and the specific question I am feeling welcome here 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 sample formula checks the response to a specific question I am feeling welcome here in the seeded Onboarding Survey questionnaire to activate other tasks. If the response to the question is Yes (response code 8237), it activates the task where the user is asked to fill a feedback form on how their first few days have been. Note that the FEELING_WELCOME_HERE value set created in step 2 is used along with the response code 8237 for Yes.
INPUTS ARE ALLOCATED_CHECKLIST_ID(number)
DEFAULT FOR L_ATTR IS '0'
ELIGIBLE = 'N'
ALLOCATED_CHECKLIST_ID_STR = TO_CHAR(ALLOCATED_CHECKLIST_ID)
QUERY = 'XXX'
QUERY = '|=AllocatedChecklistId='''||ALLOCATED_CHECKLIST_ID_STR||''''
L_ATTR = GET_VALUE_SET('FEELING_WELCOME_HERE',QUERY)
IF INSTR(L_ATTR, '8237', 1, 1) > 0 THEN
(
ELIGIBLE = 'Y'
)
ELSE
(
ELIGIBLE = 'N'
)
RETURN ELIGIBLE
The second sample formula checks the response to the same question I am feeling welcome here in the seeded Onboarding Survey questionnaire to activate other tasks. If the response to the question is No (response code 8238), it activates the task where the user is asked to provide suggestions on how the process can be improved, so that they feel more welcomed. Note that the FEELING_WELCOME_HERE value set created in step 2 is used along with the response code 8238 for No.
INPUTS ARE ALLOCATED_CHECKLIST_ID(number)
DEFAULT FOR L_ATTR IS '0'
ELIGIBLE = 'N'
ALLOCATED_CHECKLIST_ID_STR = TO_CHAR(ALLOCATED_CHECKLIST_ID)
QUERY = 'XXX'
QUERY = '|=AllocatedChecklistId='''||ALLOCATED_CHECKLIST_ID_STR||''''
L_ATTR = GET_VALUE_SET('FEELING_WELCOME_HERE',QUERY)
IF INSTR(L_ATTR, '8238', 1, 1) > 0 THEN
(
ELIGIBLE = 'Y'
)
ELSE
(
ELIGIBLE = 'N'
)
RETURN ELIGIBLE

You can use the fast formulas while creating eligibility profiles. The fast formulas can then be used as activation criteria for the task to be activated based on the response to the questionnaire. Make sure that you set the Questionnaire task as the preceding task of the task to be activated.

You can use the same steps to create the value set and fast formulas for the second question which has single choice list as the response type. A new value set is needed for the second question because it has a different question ID. Other values in the fast formula, such as Value Set Name and Response Code can be used according to the response for which the fast formula is being written. Rest of the steps will be the same.