cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
smorley
Resolver III
Resolver III

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
Resolver III
Resolver III

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
Resolver III
Resolver III

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

@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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,269)