最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Embedded Data Not Setting via JavaScript in Qualtrics Block - Stack Overflow

programmeradmin3浏览0评论

I'm trying to dynamically set an Embedded Data field called nparent using JavaScript within a Qualtrics question block, but it's not working.

Here’s what I’ve done:

I have a question called nparent with two options:
Ja (recode value: 2)
Nei (recode value: 1)

I want to set nparent as false if the user selects "Nei" and true otherwise, so I can use it for logic in subsequent questions in the same block. Here’s the JavaScript I’ve tried:

js Copy Edit

Qualtrics.SurveyEngine.addOnPageSubmit(function() {
    var selected = "${q://QID1215410936/SelectedChoicesRecode}";

    if (selected === "1") {
        Qualtrics.SurveyEngine.setEmbeddedData("nparent", "false");
    } else {
        Qualtrics.SurveyEngine.setEmbeddedData("nparent", "true");
    }
});

Any insights into what I might be missing?

Appreciate any help!

发布评论

评论列表(0)

  1. 暂无评论