Getting ResponseID using JavaScript with getEmbeddedData?

ar0ar0 Community Member Qubie ✭

Getting ResponseID using JavaScript with getEmbeddedData?

I've used Survey Flow to Set Embedded Data, adding ResponseID at the beginning of the survey. I'd like to get the ResponseID using JavaScript.

Although I can pipe the ResponseID as text into the question text, the following JavaScript does not work:

   console.log("In function added via addOnload");
    console.log(Qualtrics.SurveyEngine.getEmbeddedData('ResponseID')); // prints `null`


Best Answers

  • [Deleted User][Deleted User] Qubie ✭
    edited February 2019 Accepted Answer

    Hello @ar0 ,

    To read embedded data in the JS we use piped text of embedded data wrapped with the double quotes. For eg:



    var s = "${e://Field/ResponseID}";
  • ar0ar0 Community Member Qubie ✭
    Accepted Answer

    Here's the solution:


    Works as expected. There is no mention of this "$" syntax on the JavaScript API page.

Sign In to Comment