cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

Creating a summary email from a SharePoint calendar using filter array?

Hi,

 

I am trying to create a Flow that looks up the events on a SharePoint calendar and then send an email containing the events for the upcomming day to an email address.  I've been working through the threads on this forum and although I have got further down the road with this I am still hitting an issue.

 

This is what I have so far, the SharePoint calendar has 4 entries, 2 for each day (today/tomorrow at time of testing)

 

calendar.jpg

 

The flow I've created looks like this:

 

emailsummary.jpg

 

The filter array code is:

 

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

 

This flow runs without error but the email I get looks like this:

 

emailresult.jpg

 

As you can see it's bringing back all the events?

 

As a side note, if someone can suggest how I can get the time to just show the short time that would also be great.

 

Any thoughts gratefully received.

 

Rob

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Member

Re: Creating a summary email from a SharePoint calendar using filter array?

Hi Rob,

 

I built a similar Flow to yours to get the current day's events emailed to me each morning.  The only down side is that I have not figured out how to capture reoccuring events or ones that go multiple days (ie. week off for vacation).  Only the first date registers for those.  I used "Filter Query" under advanced options for the "Get Items" action.  That's what only captures the current day.  I also included how I formatted the time to display in the emails.  The only thing to keep in mind with that portion is if you format your time zone in it, "all day" events will not display as 12:00am to 11:59pm.  Hopefully this gives you some guidance and you can make adjustments as needed.

 

Filter query: EventDate ge 'utcNow('yyyy-MM-ddT00:00:00Z')' and EventDate lt 'addDays(utcNow(),1,'yyyy-MM-ddT00:00:00Z')'Filter query: EventDate ge 'utcNow('yyyy-MM-ddT00:00:00Z')' and EventDate lt 'addDays(utcNow(),1,'yyyy-MM-ddT00:00:00Z')'Runs successfullyRuns successfullyAs displayed in emailAs displayed in email

Michael

View solution in original post

2 REPLIES 2
Highlighted
New Member

Re: Creating a summary email from a SharePoint calendar using filter array?

Hi Rob,

 

I built a similar Flow to yours to get the current day's events emailed to me each morning.  The only down side is that I have not figured out how to capture reoccuring events or ones that go multiple days (ie. week off for vacation).  Only the first date registers for those.  I used "Filter Query" under advanced options for the "Get Items" action.  That's what only captures the current day.  I also included how I formatted the time to display in the emails.  The only thing to keep in mind with that portion is if you format your time zone in it, "all day" events will not display as 12:00am to 11:59pm.  Hopefully this gives you some guidance and you can make adjustments as needed.

 

Filter query: EventDate ge 'utcNow('yyyy-MM-ddT00:00:00Z')' and EventDate lt 'addDays(utcNow(),1,'yyyy-MM-ddT00:00:00Z')'Filter query: EventDate ge 'utcNow('yyyy-MM-ddT00:00:00Z')' and EventDate lt 'addDays(utcNow(),1,'yyyy-MM-ddT00:00:00Z')'Runs successfullyRuns successfullyAs displayed in emailAs displayed in email

Michael

View solution in original post

Highlighted
Helper IV
Helper IV

Re: Creating a summary email from a SharePoint calendar using filter array?

Hi @mgiuliani

 

Many thanks for that, I was just looking at the filter query stuff when I got the alert about your reply.

 

I am going to have a play to see if I can get the all day events to display slightly differently but overall I'm very happy - big thanks.

 

Have a good weekend.

 

Rob

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (7,977)