I want to add custom labels to the NPS question type. I want the scale 0-6 to carry the individual labels "NO", 7-8 the labels "Maybe" and 9-10 the labels "Yes"
ADDING CUSTOM LABELS TO THE NET PROMOTER SYSTEM QUESTION TYPE
Best answer by Tom_1842
The below is working okay for me:
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
var qContainer = this.getQuestionContainer();
// Hide the existing ColumnLabels row
var columnLabelsRow = qContainer.querySelector("tr .ColumnLabels");
if (columnLabelsRow) {
columnLabelsRow.parentElement.style.display = "none";
}
// Create a new row for the labels
var labelRow = document.createElement("tr");
labelRow.className = "nps-top-labels";
// Define labels
var labels = [
"No", "No", "No", "No", "No", "No", "No", "Maybe", "Maybe", "Yes", "Yes"
];
// Create and append <th> to the new row
labels.forEach(function(labelText) {
var th = document.createElement("th");
th.style.textAlign = "center";
th.style.width = "9.09%";
th.innerText = labelText;
labelRow.appendChild(th);
});
// Insert the new row before the buttons row
var table = qContainer.querySelector("table tbody");
if (table && table.children.length > 1) {
table.insertBefore(labelRow, table.children[1]);
}
});
However, it doesn't look the greatest on Mobile, and fitting 11 labels horizontally on a mobile screen might be tough. You could change the above code to only add the labels for screens above a certain width, or change the label values/font-size for screens below a certain width.
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

