How to include answer details in an end of survey message? | XM Community
Skip to main content

Hey everyone!

I’m slowly getting frustrated here 😅

I want to set up a customized end of survey message that includes an clickable URL.based on the answers given.

To be more specific, I need to include the answers of the questions as parameter into the URL:

If  the answers to the question 1 is A, to question 2 is D and question 3 is E, the URL should end with “ ...]?Q1=A&Q2=D&Q3=E”

As the survey has many questions customizing it based on branches doesn’t seem feasible.

Anyone knows how to do that?

Create custom end of survey message in library and pipe one embedded field into it. Store the value in embedded field and update its value based on question response one by one using JS.

e.g.: Q1=A and Q2=B and your embedded field name is QvalueLink.

 

Set below JS in Q1 and replace the QID and piping value as mentioned in code’s comment.

var valX = '${e://Field/QvalueLink}';

var Q1val='${q://QID2/ChoiceGroup/SelectedChoices}' /*my Q1 Qualtrics question id is QID2 and it's a single select question and it will pipe the selected answer's text. Currently it's opened and below recode piping is closed.*/

//var Q1val='${q://QID2/SelectedChoicesRecode}' /*again my Q1 Qualtrics question id is QID2 and it's a single select question and it will pipe the selected answer's recode. Currently it's closed, if you want to pipe code then open this and close above line.*/

var finalValX= valX + "?Q1=" + Q1val;

Qualtrics.SurveyEngine.setEmbeddedData( 'QvalueLink', finalValX );

 

Set below JS in Q1 and replace the QID and piping value as mentioned in code’s comment.

var valX = '${e://Field/QvalueLink}';

var Q2val='${q://QID3/ChoiceGroup/SelectedChoices}' /*my Q2 Qualtrics question id is QID3 and it's a single select question and it will pipe the selected answer's text. Currently it's opened and below recode piping is closed.*/

//var Q2val='${q://QID3/SelectedChoicesRecode}' /*again my Q2 Qualtrics question id is QID3 and it's a single select question and it will pipe the selected answer's recode. Currently it's closed, if you want to pipe code then open this and close above line.*/

var finalValX= valX + "&Q2=" + Q2val;

Qualtrics.SurveyEngine.setEmbeddedData( 'QvalueLink', finalValX );

do same process for further questions.

append ${e://Field/QvalueLink} at the end of the link. Please do not add “& or ?” as it will pipe from the JS code. Try it and test it properly before going live.


Hi @FloFunk,

 

Could you please clarify why you want them in URL in first place? Keeping the data in URL can result in data security concerns.

If you are looking to show report at the end of the survey, Qualtrics do have an option for that. You can use single reponse report link to share the report or even send email with required embedded data.

https://www.qualtrics.com/support/survey-platform/actions-module/email-task/

 

If you are looking to fetch Question wise data by API, you can use Qualtrics API to fetch the data of praticular record or if you have an API build, you can call that from surveyflow or workflow itself.

 

I would not recommend passing the data in querystring similar to example you have given.

 

Thanks,

JB

 


Create custom end of survey message in library and pipe one embedded field into it. Store the value in embedded field and update its value based on question response one by one using JS.

e.g.: Q1=A and Q2=B and your embedded field name is QvalueLink.

 

Set below JS in Q1 and replace the QID and piping value as mentioned in code’s comment.

var valX = '${e://Field/QvalueLink}';

var Q1val='${q://QID2/ChoiceGroup/SelectedChoices}' /*my Q1 Qualtrics question id is QID2 and it's a single select question and it will pipe the selected answer's text. Currently it's opened and below recode piping is closed.*/

//var Q1val='${q://QID2/SelectedChoicesRecode}' /*again my Q1 Qualtrics question id is QID2 and it's a single select question and it will pipe the selected answer's recode. Currently it's closed, if you want to pipe code then open this and close above line.*/

var finalValX= valX + "?Q1=" + Q1val;

Qualtrics.SurveyEngine.setEmbeddedData( 'QvalueLink', finalValX );

 

Set below JS in Q1 and replace the QID and piping value as mentioned in code’s comment.

var valX = '${e://Field/QvalueLink}';

var Q2val='${q://QID3/ChoiceGroup/SelectedChoices}' /*my Q2 Qualtrics question id is QID3 and it's a single select question and it will pipe the selected answer's text. Currently it's opened and below recode piping is closed.*/

//var Q2val='${q://QID3/SelectedChoicesRecode}' /*again my Q2 Qualtrics question id is QID3 and it's a single select question and it will pipe the selected answer's recode. Currently it's closed, if you want to pipe code then open this and close above line.*/

var finalValX= valX + "&Q2=" + Q2val;

Qualtrics.SurveyEngine.setEmbeddedData( 'QvalueLink', finalValX );

do same process for further questions.

append ${e://Field/QvalueLink} at the end of the link. Please do not add “& or ?” as it will pipe from the JS code. Try it and test it properly before going live.

 

Thank you for your input!

I managed to get the link generated and integrated as “Link” in the end of survey message.

Testing it, I can see it after the survey, but it’s not cklickable? (Meaning, the participants would need to copy and paste it into their browser).

Does anyone know how to get it clickable?

Thanks again!


Hi @FloFunk , you can create your anchor tag dynamically like this.

In your end of survey page, click on More > link option, after clicking “More” option is will appear as “Less” as mentioned in below screenshot.

 

 


Leave a Reply