Trigger survey based on date provided by participant | XM Community
Skip to main content

Hi there,
I'm conducting a longitudinal survey where a participant will complete questionnaires at 5 timepoints. I've linked all the surveys together with embedded data.
When the participant completes the first survey, their contact details and relevant embedded data are populated into XM Directory. Normally I would then create a workflow to schedule the next survey to be distributed to the respondent x days later, however this won't quite work for what I want to do.
Participants are sent a link by their GP practice to take part in the survey - this is approximately one week before they are due to have an appointment with their doctor. As part of this survey, they're asked to provide the date of their upcoming GP appointment (this is done as a text response/content validation question and entered as dd/mm/yyyy).
I need for the second survey to be distributed 7 days after the date respondents give in the survey. I've set that response to be an embedded data field within the contact list in XM Directory, but then I'm not sure how to take it from there, if it's possible?
If not, does anyone know if there are any workarounds rather than manually setting a schedule based on respondent responses?
Thanks in advance :)

Hello RachDH
Yes, there is a way! Not straightforward but with a custom code.
Step1: Get the dates in one format (ISO 8601 ), your respondent might be typing it in mm/dd/yyyy you can convert the same via Javascript. You should consider using moment.js. Load moment.js in the survey header, then it can be used to parse and format the date. You can also add or subtract the number of days dynamically via custom code.
e.g.: var SENDDATE= moment("${q://QID3/ChoiceTextEntryValue}").toISOString();
Step2: Once you have the dates converted push them back in embedded data to store them for each respondent.
e.g.: Qualtrics.SurveyEngine.setEmbeddedData( 'DATE', 'SENDDATE' );
Step3: Create a Workflow after the response is recorded with an API task to send email distribution. Pipe the embedded data DATE in the place of sendDate.
This will automate the process for you!

Hope this helps!






Leave a Reply