When your TeamDesk database triggers an email notifying recipients about an event, it would be handy to provide them with an easy way to import this event to their local calendar app.

In TeamDesk, such an event-adding request can be generated by a Formula-URL column inserted into a file attachment created by a workflow action.

Assume that you use the “Events” table for event records creation and this table includes Description, Start and End columns of the text and timestamp types respectively. So, these three columns keep main info of an event.

Additional columns

To customize an email alert comprising a request of adding an event to a local calendar app, you would need to create two additional columns in the Events table. The first column should be a column of the Formula-URL type and the second – a File Attachment column.

Insert the following formula into the Formula-URL column:

“data:text/calendar,” & URLEncode(List(“\n”,
“PRODID:” & URLRoot(),
“UID:” & List(“/”, URLRoot(), TableId(), RecordId()),
“DTSTAMP:” & Left(Replace(Replace(XMLFormat([Date Created]),”-“,””),”:”,””),15) & “Z”,
“DTSTART:” & Left(Replace(Replace(XMLFormat([Start]),”-“,””),”:”,””),15) & “Z”,
“DTEND:” & Left(Replace(Replace(XMLFormat([End]),”-“,””),”:”,””),15) & “Z”,
“SUMMARY:” & [Description],

Custom button with workflow actions

On the next step, a custom button can be created:

Firstly, the button generates a file in the File Attachment column. Secondly, it sends an e-mail alert comprising the attached file. Therefore, you need to add two actions to the “Send E-mail with Generated Attachment” button.

For example, the “Create Attachment” update record action:

And the “Email Alert with Attachment” e-mail alert action:

Now, if you need to send an e-mail alert allowing recipients to easily add an event to their calendar app, just click on the “Send E-mail with Generated Attachment” button.

As a result, a corresponding person will receive an e-mail message with file-attachment allowing to add an event to a local calendar app.

Please note that since there is no way to specify the filename in data URL, attachments’ names will always be like “data.ics”.

Furthermore, to explore a real-life working application and learn more details about the described example, please try Event Adding to Local Calendar App template.