Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

How to post a message in Microsoft Teams if an event exists on a SharePoint calendar

(0) ShareShare
ReportReport
Posted on by

I would like to create a flow that automatically posts a message in a Microsoft Teams channel if an event exists on a SharePoint calendar for the current day.

 

The message in Microsoft Teams would include event details. 

 

Please share any ideas for how to create this. 

 

  • Community Power Platform Member Profile Picture
    on at
    Re: How to post a message in Microsoft Teams if an event exists on a SharePoint calendar

    Kris,

     

    I was able to get this flow to work by adding a number to the "Top Count" field in the Get Items step. It appeared the flow was only looking at a subset of the calendar events. 

     

    Now, I am trying to figure out how to add space between the table columns. The text is too close together. Can this be achieved?

     

    I am also seeing this issue now:

     

    The execution of template action 'Select' failed: The evaluation of 'query' action 'where' expression '{ "Title": "@formatDateTime(item()?['Title'],'MM/dd')", "Start": "@formatDateTime(item()?['EventDate'],'MM/dd')", "End": "@formatDateTime(item()?['EndDate'],'MM/dd')" }' failed: 'In function 'formatDateTime', the value provided for date time string 'Peggy - Vacation' was not valid. The datetime string must match ISO 8601 format.'.

     

    Kelli

  • Community Power Platform Member Profile Picture
    on at
    Re: How to post a message in Microsoft Teams if an event exists on a SharePoint calendar

    Kris, 

     

    My flow and event is setup the same way as shown in your screenshots. 

     

    I would share screenshots of my flow and event, but I do not see an option in the rich text editor to upload images. I have an event on the calendar today and when the flow runs the flow shows the condition was not met. This is not expected since today's calendar event should be recognized and a reminder should be sent.

     

    Kelli

  • v-xida-msft Profile Picture
    on at
    Re: How to post a message in Microsoft Teams if an event exists on a SharePoint calendar

    Hi @Anonymous,

     

    Could you please show a bit more about the All-Day event that you mentioned within your SharePoint calendar list?

     

    I have created an All-Day calendar event in my SharePoint calendar list and the details as below:2.JPG

     

     

    I have made a test on my side based on the date/time condition that I provided before and the flow works well. My flow's configuration as below:3.JPG

    The flow works successfully as below:4.JPG

    The All-Day event in my SharePoint calendar list today could be retrieved as above.

     

    Please check if you have typed proper formula within Condition box of the Filter array action within your flow.

     

     

    Best regards,

    Kris

  • Community Power Platform Member Profile Picture
    on at
    Re: How to post a message in Microsoft Teams if an event exists on a SharePoint calendar

    Kris,

     

    Thank you! This is very helpful. 

     

    I tested the flow but did not receive the expected results. I have an all day event on the SharePoint calendar for today but a message was not posted to Teams and the flow results indicate no events matched the date/time condition. 

     

    Kelli

  • v-xida-msft Profile Picture
    on at
    Re: How to post a message in Microsoft Teams if an event exists on a SharePoint calendar

    Hi @Anonymous,

     

    Do you want to check if there is an event existing on current day and then post a message to Microsoft Teams?

     

    I have made a test on my side and please take a try with the following workaround:

    • Add a Recurrence trigger, Interval set to 1 and Frequency set to Day.
    • Add a "Get items" action, specify Site Address and List Name set to your Event list as a custom value.
    • Add a "Filter array" action, From set to output of "Get items" action. Click "Edit in advanced mode", type the following formula:

     

    @equals(formatDateTime(item()?['EventDate'], 'MM/dd/yyyy'), utcNow('MM/dd/yyyy'))

     

    • Add a Condition, click "Edit in advanced mode", type the following formula:

     

    @not(empty(body('Filter_array')))

     

    • Within "If/yes" branch of Condition, add a "Select" action, From set to output of "Filter array" action, Within Map entry, type 5 entries as below:

    The key of first entry set to Event Title and the corresponding value set to following formula:

     

    item()?['Title']

    The key of second entry set to Start Time and the corresponding value set to following formula:

     

     

    item()?['EventDate']

    The key of third entry set to End Time and the corresponding value set to following formula:

     

     

    item()?['EndDate']

    The key of forth entry set to Description and the corresponding value set to following formula:

     

     

    item()?['Description']

    The key of fifth entry set to Location and the corresponding value set to following formula:

     

     

    item()?['Location']

     

    Then add a "Create HTML table" action, From set to output of "Select" action, Include Headers field set to Yes.

     

    Add a "Post message" action, Message field set to output of "Create HTML table" action.

     

    Image reference:15.JPG

    16.JPGThe flow works successfully as below:17.JPG

    18.JPG

     

     

    Best regards,

    Kris 

     

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1