Hi
I need to use the state / province location data in question text, so have set an embedded data variable LOC to piped text from the geo location. That seems to work fine. However the data is a state / province abbreviation is awkward so I need to transform that to the proper name. Turns out this will be horrendously tedious and involve a huge list of if elseifs.
Anyhow, I can't seem to get even the basic code to work - I am not a programmer and am struggling with this. Everything looks fine, it just doesn
't then pipe into the question. Here's the code:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
var tempLOC = Qualtrics.SurveyEngine.getEmbeddedData("LOC");
if ( tempLOC = "ON") {
Qualtrics.SurveyEngine.setEmbeddedData("LOCNAME", "Ontario");
}
});
LOCNAME is set in the survey flow at the very start, along with LOC. There is no problem there, the embedded data works fine and comes through piped text. It just doesn't update through this function. So it must be my code somehow.
I used " " but have also tried ' ' and it doesn't work either way
Any help will be greatly appreciated!!!
Thanks
Chris
Page 1 / 1
Do this instead:
```
var tempLOC = "${e://Field/LOC}";
if( tempLOC == "ON") {
Qualtrics.SurveyEngine.setEmbeddedData("LOCNAME", "Ontario");
}
```
```
var tempLOC = "${e://Field/LOC}";
if( tempLOC == "ON") {
Qualtrics.SurveyEngine.setEmbeddedData("LOCNAME", "Ontario");
}
```
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.