Solved
Using JavaScript with Embedded Data and/or selected choices.
Can someone walk me through pulling Embedded Data and/or selected choices into a JavaScript function? As an example, let's say that I want the sum of numbers from a loop and merge block where it is possible that the user loops through 40 times. Instead of creating 40 different branches in the survey flow each with an equation, hopefully I could just set up a nice little JS function to handle the math.
And the answer is yes, I have done this just because I was too "lazy" to spend the time to figure out and use JS for this survey.
Best answer by AnthonyR
Absolutely!
You can use piped text in your JavaScript, so using something like this will pull answers in just fine:
`var answer = "${e://Field/answer}";`
If that answer embedded data is a number, then you should use parseInt() on it to use it as a number in JavaScript.
`var answer = parseInt(${e://Field/answer});`
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt
Rinse and repeat for anything you need to pull in, using the appropriate piped text.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

The code runs when the QID5 option is changed.
the console shows element1 = empty (actually not sure if null, empty, or space)
the console shows element2 = require
the console shows element3 = require
I am sure I am doing something silly. I can get and change the information using the document object model, but I would prefer to be more direct (ie using Qualtrics functions) as the DOM could change.
Thanks,
Rett
P.S. Sorry I had to include an image of the code. Whenever I tried to include the code I received an access error. I have a call in to Qualtrics support to see what was going on.