Pulling part of a selection from a drop down into the response of a free text question. | XM Community
Skip to main content
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
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.
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.
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