Two Part Survey Help | XM Community
Skip to main content

I'm trying to make a workaround for Qualtric's lack of expiring links for a survey. There are two parts, where people start by doing survey one, and then the experimental condition comes from whether they get an email immediately after the first survey, three days after, or two weeks after. The goal is to be sure that after they receive the email link that they are not able to answer it the day after. For example, if they’re given an email via the three days later condition and then don’t check their email, I do not want them to be able to finish it five days later. Or, if they were sent the email immediately, they should not be able to complete it after a day. 
The branch logic does not seem to be functioning, and I am wondering where the issue is stemming from. 
Below are pictures of the JavaScript from parts one and two of the survey, the problem branch of the part two survey, and a view of the embedded data elements:
https://imgur.com/a/VNVSKlM
The branch logic in the second survey currently does not end the survey under any circumstances, even if the dates passed to it satisfy the condition. I also tested this by comparing the dates (i.e., if today > expTmr. That is, if the current date is greater than the expiration date) rather than creating a boolean value. Using custom JS and the console, it’s easy to see whether the values return as True or False, but the Qualtrics branch logic does not seem to mind either way.
Any guidance would be greatly appreciated!

Note: We cannot use the personal link since there isn't an email list; it's based on people picking our survey and finishing the first part.


I don't have any input on the JavaScript, but re: the personal link situation: one workaround I've had success with is creating a dummy contact list and creating the personal links based on that.
image.pngDepending on the structure of your project, if you use the same set of External Data Reference numbers, you could generate links for the second part of the survey, add those as a contact field, and reupload the dummy list to generate personal links for the first part. You can then add that custom link as an embedded data value to direct respondents to their personal link for the second half. I know this doesn't address your whole question but I hope it helps!


Hey melancond1, how are you passing data from your first survey to your second? Are you familiar with or using query strings? They're awesome, I use them all the time. You could take out some complexity by doing the calculation for days in the first survey like you are, then appending a query string integer (for days) onto the link emailed to the survey respondent. I believe this takes away the need for the JS/addEmbeddedData in the second survey as you'd be setting your days integer in the survey link.

Also an important side note: you can't use embedded data on the same page as you set it. This has bitten me before and I wonder if that's what is happening to you.


Leave a Reply