cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
New Member

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
New Member

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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (12,544)