At one point in my survey (using anonymous links), respondents are redirected out to an external website to complete a task, then redirected back to the survey upon completion:
Qualtrics.SurveyEngine.addOnload(function() {
var taskStatus = "${e://Field/taskStatus}"
if(taskStatus == "0") {
var taskStatus = 1
Qualtrics.SurveyEngine.setEmbeddedData("taskStatus",taskStatus);
var targetURL="${e://Field/baseURL}"+"${e://Field/outURL}"
window.location.replace(targetURL);
} else {
this.clickNextButton();
}
});
For any browser in Windows, the redirect happens correctly. When the respondent is returned to the survey, ${e://Field/taskStatus} = 1
and they are sent to the next question.
For any browser in iOS/MacOS, the redirect happens correctly. When the respondent is returned to the survey, ${e://Field/taskStatus} = 0
and they are redirected back to the task.
How should I get ${e://Field/taskStatus}
to consistently equal 1 upon return?