Hi community,
I have a Highlight Question with a paragraph of text. There's only 1 category: "Contains a G." I ask participants to highlight all of the words that contain a G.
How do I set embedded data representing the number of words that they highlighted?
I want to tell participants in the next block, "You selected ${e://Field/num_gs_highlighted} words that round." I can't find anything in Scoring, unfortunately.
Thanks, as always!
Set embedded data: Counting the number of words selected in a Highlight Question
Best answer by wscampbell
This was solved on a different thread by GrumpyCivet. The solution here involves to steps:
- Create an embedded data field that captures the selected words from the Highlight question.
- Use JavaScript in a subsequent question to count the length of that embedded data field (by counting the number of commas).
How to do this:
- In the survey flow, set embedded data from the selected choices of the Highlight question. For instance, set
high_string
to ${q://QIDXXXXX/ChoiceGroup/SelectedChoices} - Also in your survey flow, create an additional embedded data field (e.g., called
word_count
) before the block that contains the Highlight question. Then, implement this solution is from GrumpyCivet HERE: In a later question, embed the following JS:
var myString = Qualtrics.SurveyEngine.getEmbeddedData("high_string");
var wordCount =0;
wordCount = myString.trim().split(',').length;
Qualtrics.SurveyEngine.setEmbeddedData("word_count", wordCount);
Voila! Thanks to GrumpyCivet for solving this one!
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.
