Solved
Is there a way to autocalculate a survey expiration date?
The survey I am conducting needs to be completed within 7 days of another task. I upload the TaskDate as an embedded item in the contact list.
Is there a way to auto-calculate an expiration date for the individual emails that are sent out?
Alternatively, I can auto-calculate the expiration date in the excel contact sheet, is there a way to import an expiration date into a survey link?
Thanks!
Best answer by mattyb513
I don't think you can do this in a built-in way, but you could use logic in your survey flow to handle it. I've seen some surveys where it checks after each block whether a condition is met and ends the survey if so.
You would probably need to evaluate the date using JavaScript as I don't think Embedded Data has that capability. So on the first page of the survey, you could have JavaScript doing something like:
```javascript
var expDate = Qualtrics.SurveyEngine.getEmbeddedData('customExpirationDate');
expDate = new Date(expDate);
if (expDate < new Date()) {
Qualtrics.SurveyEngine.setEmbeddedData('expired','true');
}
```
Then after that block you could add an if statement in the Survey Flow that says "If Embedded Data `expired` = `true` then End Survey.
Consider the fact that if people enter the survey in time but then leave and return after the time, this would not catch them. You would need this logic on every page of your survey in that case.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
