Email trigger to include an Outlook calendar invite | XM Community
Skip to main content
Does anyone know if it is possible to create an outlook calendar invite attachment based on a date selected in a survey and attach it to email trigger?



The idea being to send an outlook calendar invite after someone signs up for specific time slot.
Hi there, 'just curious to know if you found out the answer to your question. I was looking to do the same thing. I was thinking more of using a google calendar, but I'm assuming that if the feature is available it would be compatible with more than just outlook. Let me know if you can, 'would really appreciate it. Thanks!
Unfortunately no :neutral:
I found 2 solutions to your problem:



1 - Survey Termination



This method causes the custom ICS file to be automatically downloaded after the user Submits. This will replace any final message.



At survey end, redirect to a full URL and use the webservice from Agical.io which generates ICS files on the fly.



The base url is `http://ics.agical.io/` and the minimum parameters you will likely use are subject, location, start date/time (dtstart), and end date/time (dtend). For example, using these parameters:



subject=Fourth%20of%20July

location=Community%20Auditorium

dtstart=2018-07-04T15:00:00-04:00

dtend=2018-07-04T16:00:00-04:00



the full url is:



`http://ics.agical.io/?subject=Fourth%20of%20July&location=Community%20Auditorium&dtstart=2018-07-04T15:00:00-04:00&dtend=2018-07-04T16:00:00-04:00`



Note that the Date/Times are in ISO format and, of course, you'd need to replace the values in the string with embedded field strings containing the event description. Before the last question, you'll

need to convert the date picked to ISO and store it in an embedded field so the generated URL can read it.



To generate a Google "add to calendar" use `format=gcal`.





2 - Generate ICS as part of the survey flow



This method causes the custom ICS file to be automatically downloaded before the user submits. This allows you to conditionally provide it to the user based on their preferences.



Download https://github.com/nwcell/ics.js and upload two .js files (either of the ics files and the ics.deps.min.js) into your Qualtrics library. Then, include them in the header like this:



 

<script type="text/javascript" src="https://xxx.az1.qualtrics.com/ControlPanel/File.php?F=F_5ci9xpvtuLRiiaT"></script>

<script type="text/javascript" src="https://xxx.az1.qualtrics.com/ControlPanel/File.php?F=F_56LodesR935noqh"></script>



To test, I used the Qualtrics provided date-picker. You can easily import it by selecting the second variation in the Demographics/Calendar & Date Questions.



After a page break, or in the next block, you can reference the date picked.



Here is the question javascript code to instantiate the ics file and convert the date:



var cal = ics();

var pickDate = "<dollar-sign>{q://QID2/ChoiceTextEntryValue}";

var newDate = pickDate.replace(/-/g,"/");

cal.addEvent('Demo Event', 'This is an all day event', 'Nome, AK', newDate, newDate);

cal.download();

\\[Replace `<dollar sign>` above with an actual dollar symbol, the forum editor chokes when I code the $.\\]



Note that I left the default/sample values for description and location; you'd need to change those (along with the proper reference to the user date selection).



The question text should indicate the file is being downloaded or just a 'thanks.'
> @James said:



> 2 - Generate ICS as part of the survey flow

>

> This method causes the custom ICS file to be automatically downloaded before the user submits. This allows you to conditionally provide it to the user based on their preferences.

>

> Download https://github.com/nwcell/ics.js and upload two .js files (either of the ics files and the ics.deps.min.js) into your Qualtrics library. Then, include them in the header like this:

>

>  

> <script type="text/javascript" src="https://xxx.az1.qualtrics.com/ControlPanel/File.php?F=F_5ci9xpvtuLRiiaT"></script>

> <script type="text/javascript" src="https://xxx.az1.qualtrics.com/ControlPanel/File.php?F=F_56LodesR935noqh"></script>

>

> To test, I used the Qualtrics provided date-picker. You can easily import it by selecting the second variation in the Demographics/Calendar & Date Questions.

>

> After a page break, or in the next block, you can reference the date picked.

>

> Here is the question javascript code to instantiate the ics file and convert the date:

>

> var cal = ics();

> var pickDate = "<dollar-sign>{q://QID2/ChoiceTextEntryValue}";

> var newDate = pickDate.replace(/-/g,"/");

> cal.addEvent('Demo Event', 'This is an all day event', 'Nome, AK', newDate, newDate);

> cal.download();

> \\[Replace `<dollar sign>` above with an actual dollar symbol, the forum editor chokes when I code the $.\\]

>

> Note that I left the default/sample values for description and location; you'd need to change those (along with the proper reference to the user date selection).

>

> The question text should indicate the file is being downloaded or just a 'thanks.'

>



This seems like it should work but I have not been able to upload the .js files to my library. Javascript files are not supported by the file library. I also attempted to put the entirety of the .js files (and several iterations with omitted portions) into the question's js code, but that didn't work either. Would the .js files still work if they are uploaded as .txt files or something?
Update: Yes, uploading the .js files as .txt files works.
I can confirm that the first option works great. However, instead of doing a custom redirect at the end of the survey because the "you will be redirected" message never closes, I instead generate the redirect URL through the survey flow and hyperlink a message that gets sent as part of an email trigger. Works great!

Hi, I am trying something similar but instead of choosing a date, I would set a default date. I am unsure how to code in the Qualitrics platform. I highly appreciate it if you can provide a step by step procedure on where these codes must go.
https://community.qualtrics.com/XMcommunity/discussion/comment/3437#Comment_3437


In the first example, change "dstart" and "dtend" to the desired time.
In the second example, you can remove the var assignments for "pickDate" and"newDate" and just replace it with a hard-coded value in this format:
var newDate = "08/31/2021";


https://community.qualtrics.com/XMcommunity/discussion/comment/39966#Comment_39966Did you get this to work? I am doing the same thing (I hope) Everytime I get the ics download it says the day of the event as the start and the day before the event as the end.


https://community.qualtrics.com/XMcommunity/discussion/comment/39982#Comment_39982Hi James, thanks for the reply.
I am relatively new to this platform. Could you give me resources/links that will be helpful to me in understanding where the above-suggested codes can be implemented in the Qualtrics platform?


I did this in a choice for a conference
Snag_2f4cca28.pngWhen you click on the link it downloads it for you. I am thinking that I did a google calendar event for it but not sure. here is what the coding looks like in the rich content editor
September 13, 2016 - How to write clear learning outcomes for my course (REQUIRED)- Memorial Union, Prairie Room  

https://ndstate.co1.qualtrics.com/CP/File.php?F=F_9sEowFGcaqM15Wt" target="_blank">click here to add to your calendar open the file and then save

So what I did was to load the ics file into Qualtrics file Library.


Thanks
i'll try it


This worked like a charm! I created the zoom info and the meeting info with it save the ics file and uploaded it to my files library (I decided to put it in a separate folder, just in case). On testing the survey, those who answer yes to a "Are you attending?" question. see this question (combination of skip logic and display logic) which displays the click to download link.

I wasn't quite sure which question type to use so I used a comment/text type.


the links to the github link https://github.com/nwcell/ics.js isn’t working. Does anyone have these handy so I can use them

 

found them on Github


Leave a Reply