Greetings all,
In our teams' shared Sharepoint site, there is a naming convention in place defining how folders are created in the "Events" folder: "YYYY-MM-DD Event Name". For example, 2022-11-25 Student Workshop. Would it be possible to create a flow to add a calendar event? In this case, on the 25-11-2022 create an event called Student Workshop on the shared team calendar. We then intend to put this on a page amongst other team announcements..
Thank you
Dip
Hi @diplalseta,
You could use the substring function to retrieve the first 10 characters of the folder name.
Below is an example.
This example assumes you are only creating event folders which always start with a date. If that is not the case you need to build in some checks if the folder name starts with a date or not
1. In the settings of the When a file is created (properties only) trigger action make sure you add the following expression as a trigger condition
This way the flow will only be triggered if the item is a folder
@triggerOutputs()?['body/{IsFolder}']
2. In the Create Event (v4) action use the following expression for both the start time and end time fields
formatdatetime(substring(triggerOutputs()?['body/{Name}'], 0, 10), 'yyyy-MM-ddTHH:mm:ss')
Hi @Expiscornovus
Thank you so much for your response.
I have made a step forward however have been met with a barrier. The events folder not always has a folder starting with the date - inside it there are also archive folders e.g. 2020 archive. Sample below:
I do believe this might be the reason the flow breaks:
Lastly, I was wondering whether I would need full access to the Sharepoint mailbox to be able to create events on the shared calendar?
This is the group calendar that we wish to embed in a page, however with a 30 day view if possible, and all events to be automatically within it using the flow above..
Is this something that is achievable? Thanks for all your help!
Regards,
Dip
Hi @diplalseta,
The reason that you are getting the error is because you have added the expression as plain text/string. Can you please add the expression via the expression tab to the start time and end time fields?
Hi @Expiscornovus..
Rookie mistakes on my part... The flow now runs successfully:
But I am not sure where to find it on the calendar?
Thank you again for your unconditional support.
Regards,
Dip
Update:
I am able to view the event on my personal calendar, however would like it on the shared Sharepoint site calendar - so it can be seen on the web part.
Unfortunately these are my only options for the calendar id:
Regards,
Dip
Hi @diplalseta,
That requirement makes the setup slightly more challenging because Shared Calendars are not supported in the Office 365 Outlook connector:
https://learn.microsoft.com/en-us/connectors/office365/#general-known-issues-and-limitations
A workaround would be to use the Create Event method from the Graph API though:
https://learn.microsoft.com/en-us/graph/api/calendar-post-events?view=graph-rest-1.0&tabs=http
That would mean you have to replace the Create Event (v4) action by one of the HTTP actions and interact with the Graph API instead.
Hello @Expiscornovus
I thought that it would be easier to create an Excel file with a Calendar template, with each month in a different tab:
Would it possible to set up a flow to add data into this Excel sheet (Calendar)?
Regards,
Dip