How to get an ICS file from a modern list item
With classic SharePoint there was a calendar template that could be connected to Outlook and had the possibility to generate ICS files for each one of the events. List have evolved since the old days of SharePoint 2007 and with the modern SharePoint and Microsoft Lists it is possible to transform any list into a calendar view, even the ones that were not designed with that primary goal in mind.
The flexibility provided by the modern lists is great, however it’s no longer possible to connect them to Outlook or to download an ICS file to add the event to a personal calendar.
In this article I’ll explain you how to get an ICS file that you can use in your personal Outlook calendar from any list using Power Automate integrated with Microsoft Lists.
What is an ICS file?
An ICS file is a calendar event saved using a universal calendar format used by several calendar and email applications that allow users to easily share information over email and store it in a calendar.
Each ICS file contains information about the event, including the event metadata:
- Start and End dates
- URL – used for online meetings
To learn more about the specification of the ICS file check out this article in Wikipedia.
Receive a list item ICS via email using Power Automate
Since the list service to generate the ICS is not available for modern lists, we will have to use Power Automate to generate the file and send an email to the user making the request.
To get started with this process you should do the following:
- Open your list using Microsoft Lists
- In the toolbar click in Integrate, from the menu select Power Automate and then click in Create Flow
- In the create flow pane, choose the flow Complete a custom action for the selected item
- Power Automate will open in a new browser tab, wait for the new connection to be created and click Continue
- Out of the box you will get the trigger For a selected item and the action Get item configured to your list. With these two you will get access to all the columns in the item selected on your list when the flow was triggered.
- Click on New step
- From the operation list select Initialize variable, this one will be used to store the text for the ICS file
- Provide a Name for the variable and select the Type string g. ICS
- Copy the base template for the ICS file and fill it with your own values;
BEGIN:VCALENDAR VERSION:2.0 PRODID:LISTICS BEGIN:VEVENT UID: DTSTAMP: DTSTART: DTEND: SUMMARY: DESCRIPTION: LOCATION: URL: END:VEVENT END:VCALENDAR
For the unique identifier UID of the ICS use the expression guid() form Power Automate that will generate a random and unique identifier for each execution of the flow; fill the other ICS properties with values from your list item as illustrated in the following image. If you want to learn more about each one of these properties, I recommend you have a look to this blog post.
- Click on New step
- From the operation list select Send an email (V2), this one will be used to send the ICS file to the user who started the execution of the flow
- In the To field select the User email from the For a selected item trigger, this value is always the email of the user who started the execution of the flow
- Provide a value for the Subject and Body, you can either use a static value or dynamic information from the list item
- Click in the link Show advanced options
- Provide a name for the Attachment file and make sure it ends with .ics, this extension will make the email applications recognize the attachment as calendar file.
- In the Attachments Content, use the variable with the ICS text definition
- Click on Save
With the flow implemented to receive the ICS files for each list item you should do the following:
- Open your list in Microsoft Lists
- Select the item you want to receive
- In the toolbar click in Automate, from the drop-down select your flow, the name in this menu will be the same you gave to the flow in Power Automate
- On the Run flow side panel establish the connections if it is the first time you execute it and then click Run Flow
In a few minutes you will receive the email with the attached ICS file that you can use to add the event in the calendar.
As this solution is easy to implement using Power Automate and can be used for all types of lists, keep in mind that the ICS files are static. If someone changes the date of the event in the list, it will not be reflected in the event in your calendar.
If you want to learn more about the classic calendar template and how to get the ICS files from it check out this article.
No comments yet