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

View solution in original post

@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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (3,718)