Solved
Dynamic text fills but still allow backing up
Hi everyone,
I have a survey where we need to change the text fills used in the survey based on their responses earlier on. I'll try and give you the easiest example of what I'm working with:
Q1"What sex does your spouse identify as?"
01 Male
02 Female
03 Prefer not to answer
[Compute text fill Grammar1]
If Q1=01, then 'he'
If Q1=02, then 'she'
If Q1=03, 'then your spouse'
Q2 "How old is [Grammar1]?"
[numeric entry]
The respondent MUST be able to go back from Q2 and change their answer at Q1 to update the type of text fill used throughout. I have similar questions saying 'does' vs. 'did', or 'you' vs. 'the participant', etc. The fun ones are for ages, because the respondent must be able to back up and change their age which drives show/hide logic and the text fills.
I'm unable to use Embedded Data to calculate the appropriate text because once you toss something like that into the Survey Flow, you can no longer back up to the prior block. I've had to come up with some nifty JavaScript and hidden questions to come up with show/hide logic in the past but there HAS to be a better way to do it.
Any suggestions? Thank you in advance!
Best answer by TomG
Even easier...
```
Qualtrics.SurveyEngine.addOnPageSubmit(function() {
var pipes = {
"1": "he",
"2": "she",
"3":"your spouse"
}
Qualtrics.SurveyEngine.setEmbeddedData("Grammar1", pipes[this.getSelectedChoices()]);
});
```
View originalLeave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.