Hi Team,
Embedded Field not filled before page submits as I guess..
Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
var apiResponse = JSON.parse(this.responseText);
var contactInfo = apiResponse.result.elements[0];
firstName = contactInfo.firstName;
lastName = contactInfo.lastName;
Qualtrics.SurveyEngine.setEmbeddedData("ContactFirstName", firstName);
Qualtrics.SurveyEngine.setEmbeddedData("ContactLastName", lastName);
alert(Qualtrics.SurveyEngine.getEmbeddedData("ContactFirstName"));
// Here I am able to get the first name in alert But this field not updating first name in Data & Analysis tab of Survey
}
Api is returning correct response in var apiResponse
Embedded Field not populating in Data & Analysis tab before page submits?
Leave a Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.