Hi everyone,
I'm using a slider question to record a participant's willingness to pay for a certain product as part of an economics experiment. This WTP value will be compared to a randomly generated value in the survey flow. Unfortunately I've not been able to extract the value from the slider and set it to an embedded data field.
My JS so far on the slider question is:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
var randomNum = (Math.random() * (0.21 - 0.0) + 0.0).toFixed(2);
Qualtrics.SurveyEngine.setEmbeddedData("WTP_Random", randomNum);
console.log(randomNum);
});
Qualtrics.SurveyEngine.addOnReady(function()
{
var value;
var that = this.questionId;
jQuery(document).on('change',function(){
value=parseInt(jQuery("[id='"+that+"~1~result']").val());
});
console.log(value);
Qualtrics.SurveyEngine.setEmbeddedData("WTP_Subject", value);
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});
Any help would be greatly appreciated.
Thanks, Chris
Using Javascript to get slider value and save to embedded data
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.

Add a page break after this question and then add a dummy descriptive question. Pipe both the embedded data in this dummy question.