Pulling part of a selection from a drop down into the response of a free text question. | XM Community
Solved

Pulling part of a selection from a drop down into the response of a free text question.

  • 11 October 2018
  • 4 replies
  • 7 views

Userlevel 1
Badge +1
I have a survey with a drop down that contains names and Emails ( Last, First - Email). What i would ideally have happen is when a selection is made in the drop down parse out the email and enter that text into the response of a free text question then lock that field so it cannot be changed.

Is this possible?

Thank you!
Cameron
icon

Best answer by Anonymous 12 October 2018, 08:40

View original

4 replies

Userlevel 7
Badge +33
You can get valur of entered email using pipe text and using java script parse it and store in embedded variable and use this embedded variable for next question piping.
Userlevel 1
Badge +1
Thanks for the reply! Could you give me a bit more detail on how to do that? Im pretty new to Qualtrics.
Hello @CameronBudd ,

Assuming your "free text question" is in new page(not on same page drop down question)
Also the drop down has the option exactly in this order/pattern - Last, First - Email
Paste the following code in the js(OnReady) of the "free text question"

var s="${q://QID52/ChoiceGroup/SelectedChoices}";
jQuery("#"+this.questionId+" .InputText").val(s.split("- ")[1]).attr("readonly",true);

Note: In the above code change the piped text with your question ID. Also make sure the drop down option has space after -(hyphen) and then the email.
Userlevel 7
Badge +13
Hey @CameronBudd! In the future, be sure to use "@" to tag and notify members if you have any follow up questions to ask!

Leave a Reply