cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rob_CTL
Helper V
Helper V

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
mgiuliani
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

5 REPLIES 5
mgiuliani
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

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

MattPMoS
Frequent Visitor

Hi--I'm trying to do something similar, where a Flow sends a weekly automated email including filtered data from a List. I'm very new to Sharepoint so the learning curve is steep. I am stuck because on my "Get Items" step, I can't program in the Filter because "No Dynamic Content is Available".

I've read some other posts that suggest that the issue is that I'm starting with a Recurrence, but mgiuliani's example is identical to the structure I was mapping out, just with a different date filter, and clearly it is working for them. I'm pretty defeated at this point. Any thoughts on what I'm doing wrong?

Rob_CTL
Helper V
Helper V

@MattPMoS can you post a screenshot of what you currently have?

MattPMoS
Frequent Visitor

Hi Rob and friends--I've actually figured out how to make most of this work, by manually entering the fieldnames in the Expression even when the Dynamic Content wasn't showing (I suspect that at least part of the problem is that I don't fully understand what Dynamic Content is). But with much swearing, trial-and-error, swearing, and plugging in bits and pieces from every Youtube tutorial I could find, I almost have what I want in the email data, except for one annoying thing: Two of the fields in the HTML table are derived from Multiple-Choice columns in the original List, and they are coming over with annoying [""]'s around the data.

I've read several posts about this but haven't licked it yet. I'll attach screenshots if I can figure out how, right now I'm getting a "do not have permission to upload images" footer. Thanks for your patience everyone, this is a lot harder than teaching about Frogs.

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (4,206)