Single Followup Question
For single followup questions, you can make use of the Web Service feature in Qualtrics.Setup Instructions
-
Create two Text Entry questions and place them in different blocks:
- First question: Your topic question
- Second question: The followup question
-
Set up the followup question text to use a piping reference:
- Between the blocks, create a Web Service with this configuration:
Multiple Followup Questions
For multiple followup questions, you can utilize Javascript combined with the Loop & Merge feature.1. Set Up Your Survey Structure
- Create a survey with at least two blocks:
- Topic Question Block: Contains your primary open-ended question.
- Followup Question Block: Will display each followup question.
2. Add Embedded Data Fields
In the Survey Flow, add the following Embedded Data fields to track the conversation:TopicQuestion
(stores the original question text)TopicResponse
(stores the original question response)LastQuestion
(stores the most recent question asked)LastResponse
(stores the most recent response given)FollowupText
(stores the current followup question from API)ContinueFollowups
(1 = continue loop, 0 = end loop)FollowupCount
(tracks how many followup questions have been asked)
3. Create a Loop & Merge Block
- Set up Loop & Merge on the Followup Question Block.
- Use a hidden numeric question to control the loop count (see below for code).
4. Add JavaScript to the Prime Question
Add the following JavaScript to your topic question to initialize variables and make the first API call:5. Define the API Call Function
This function makes the API call to get the next followup question from Aftercare:6. Control the Loop Count with a Hidden Numeric Question
Add this JavaScript to your hidden numeric question to hide it and set a default value:7. Add JavaScript to the Followup Question in the Loop & Merge Block
This code displays the followup question and determines whether to continue asking followups:8. (Optional) Store All Followup Questions and Responses
If you want to store all followup questions and responses for later analysis, add this code to the followup question’saddOnPageSubmit
function:
Data Quality Evaluation
To evaluate the quality of responses using Aftercare’s Data Quality API in Qualtrics, follow these steps:1. Prepare Your Survey Data
- Identify the questions and responses you want to evaluate for quality. For example, you might want to evaluate all open-ended responses in your survey for each respondent.
2. Add a Web Service Element in Survey Flow
- Insert a Web Service element after the question you want to evaluate or at the end of the survey.
- Configure the Web Service as follows:
- URL: https://surveys.getaftercare.com/api/v1/data-quality
- Method: POST
-
Body Parameters: (Content-Type: application/json)
Example body (replace QID1, QID2, etc. with your actual Qualtrics question IDs):
-
Custom Headers:
X-Aftercare-Key
:<AFTERCARE API KEY>
Content-Type
:application/json
3. Set Embedded Data
- In the Web Service element, set embedded data fields to store the results from the API response. For example:
qualityScore
= qualityScorenumIssues
= numIssueshasIssues
= hasIssues- You can also set embedded data for each entry in
evaluations
if you want to track per-question quality.
4. Use the Results
You can either:- Store these values in your survey data and export for analysis
- Or, you can access the Aftercare platform to view and download the quality evaluations.