Hello to everyone in this awesome community!
I was investigating a business requirement for one of my surveys and I wanted to ask the community's opinion on the matter.
What I want to accomplish is: If a user changes the Survey Language to e.g. "Swedish", the I want to hide the "Country" question and prefill it with the value "Sweden". I have already managed to hide the Question with a condition but I haven't found a good solution to prefill the value to Sweden.
Straight forwards solutions I found so far include:
1. Use a question default value and set it to "Sweden"
--> a side effect here is that Sweden is preselected for all users, not only for the ones who selected Swedish for the survey language
2. Create a new embedded data field which will hold the Country name. The value of the field is set by "Branches", Sweden is set when the Swedish language is selected and a piped value of the Country dropdown selection is set otherwise.
--> a side effect here is that value of the Country field is sometimes translated to the corresponding language which was selected by the user: e.g. there are entries of both Germany and Deutchland.
Anyone here have a better idea for implementing this requirement? Preferably, a solution that doesn't have side effects.
Thank you all in advance!
Hide and prefill a question value
Best answer by Rudi
Hi MDyDiana
what you could do is to add a javaScript to the country question
when Q_Language isn't equal to your standard question
then you could set the question according to the language using the function
this.setChoiceValueByRecodeValue()
for example:
let selectedLanguage = "${e://Field/Q_Language}"
if(selectedLanguage == "SE"){
this.setChoiceValueByRecodeValue(2,1) // 2 being the recode for Sweden in your country question
this.clickNextButton() // automatically click the next button
}else if(selectedLanguage == 'JA' ){
this.setChoiceValueByRecodeValue(5,1) // 5 being the recode for Japan in your country question
this.clickNextButton() // automatically click the next button
}
you could repeat the else-if-conditions for all languages for which you set the country by script. For the remaining languages, the question would be still displayed
Add your script to the OnLoad function
Best regards
Rudi
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
