cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
smorley
Post Patron
Post Patron

SharePoint Time off calendar and daily email

Hi everyone, Happy New Year!

 

I have a SharePoint list.timeofflist.jpg

It has 2 records that have an end date greater than today.  I would like those 2 to be included in a daily email.  Here's my flow at a high level.  timeoffflow.jpg

Inside the apply to each loop, the flow is looping through the SharePoint list.  I'm asking it append to a string variable called "Employee" if the end date is greater than or equal to UTCNow().  (I actually want it be if the start time is less than or equal to now as well, to show who is off today.)condition to check for time off.png

Anyway, I am using the format for UTCNow() of formatDateTime(utcNow(),'dd-MMMM-yyyy'), and the email that I get returns all 6 records in the SharePoint list.  

 

There must be something going on with my syntax in the condition statement.  Any help, as always, would be greatly appreciated.

 

1 ACCEPTED SOLUTION

Accepted Solutions
smorley
Post Patron
Post Patron

So I solved my own problem.  The condition was failing on the formatting of UTC now.  Once it stripped it away, the flow works fine.utcnow.jpg

View solution in original post

3 REPLIES 3
smorley
Post Patron
Post Patron

So I solved my own problem.  The condition was failing on the formatting of UTC now.  Once it stripped it away, the flow works fine.utcnow.jpg

annajhaveri
Community Champion
Community Champion

@smorley , if you just want items which have end date greater than today, one more efficient way of doing this is filtering the items in Get Items action using Filter Query as shown in below example screenshot, this will make performance of your flow efficient. You just need filter query 'EndDate gt 'formatDateTime(utcNow(),'yyyy-MM-dd')'

 

Screenshot 2020-12-18 131002.png

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Thanks @annajhaveri - I have that in place now. Thanks.getitems.jpg

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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,406)