cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Tbruns
Level: Powered On

Help building a flow for Sharepoint List to email me events for today

I have created a flow to email me each morning with the events on the calendar for today. It works except for when there is a specific time frame for an event. Can someone please advise what I need to change or add to get it to pull all events? Thank you!

This first picture is a screen shot of todays events. As you can see some have a specific time frame. Those are the ones that Flow is not including.

03-02-2019 2-45-07 PM.jpg

03-02-2019 2-46-58 PM.jpg03-02-2019 2-47-13 PM.jpg03-02-2019 2-47-23 PM.jpg03-02-2019 2-47-36 PM.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Tbruns
Level: Powered On

Re: Help building a flow for Sharepoint Calendar

I was able to get it to work by using the following:

EventDate ge '@{utcNow('yyyy-MM-ddT00:00:00Z')}' and EventDate lt '@{addDays(utcNow(),1,'yyyy-MM-ddT00:00:00Z')}'

View solution in original post

12 REPLIES 12
Super User
Super User

Re: Help building a flow for Sharepoint Calendar

Hi there.

What is the full utcNow() in Filter Array 2 please? Also, if possible screen grab or post the JSON output of a successful run on Get items.

Thanks, Alan

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Tbruns
Level: Powered On

Re: Help building a flow for Sharepoint Calendar

Filter array 2 is @equals(item()?['EndDate'], utcNow('yyyy-MM-dd'))
Is this what you are wanting? Sorry still new to flow.

03-04-2019 7-48-26 AM.jpg03-04-2019 7-48-39 AM.jpg03-04-2019 7-48-51 AM.jpg

Tbruns
Level: Powered On

Re: Help building a flow for Sharepoint Calendar

Can anyone assist please?

Super User
Super User

Re: Help building a flow for Sharepoint Calendar

Hi @Tbruns , sorry for the delayed reply. 

 

Can I just check something please?

You say in your initial post "I have created a flow to email me each morning with the events on the calendar for today"

Are you asking to get what's in your Office 365 calendar for that day?

I ask as I see in your screen grabs that you are using a SharePoint List to pull this data.

 

I have the same Flow running and working and here it is:Capture-324.png

  • It runs at 7am Daily
  • Get's the events for the next 12 hours, regardless of start and end time
  • This is achived by a filter with the code below.
Start ge @{utcNow()} AND End le @{addHours(utcNow(), 12)}

Does this meet the requirements you are looking for bypassing the list perhaps?

p.s. Just add a send email to it and change the time frame to suit. The start date in the recurrence is only added once and "at these hours" means it runs at 7am like clockwork.

This would be the best way to get "the events on the calendar for today" as it looks to be Office 365 you are using for your mail/calendar.

 

If you have found my post helpful, please mark thumbs up.

If this post has solved your problem, please click "Accept as Solution".

Any other questions, just ask.

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Tbruns
Level: Powered On

Re: Help building a flow for Sharepoint Calendar

It is a Sharepoint List that we view as a calendar (Sorry for the confusion)

 

As you can see in the attachment i am having an issue with the ones highlighted in yellow not coming through on the email. The only thing that is common b/t them are that they do not have the "All Day Event" field marked as yes. But the other issue is that there is a reoccuring item (highlighter in pink) that does not have it marked but it does show on the email.

Also how do I get the email to show the date in the same format as sharepoint does?

03-08-2019 8-22-13 AM.jpg

Super User
Super User

Re: Help building a flow for Sharepoint Calendar

Hi @Tbruns .

Similar to what you have done in post 3.

Can you get me a full JSON output for at least one calendar event / list entry please.

If you copy the code from the "Body" and wittle it down a little to show an event or 2 I will come back with what I believe you should do to get this working and you can try it.

 

Thanks, Alan

 

If you have found my posts helpful, please mark them thumbs up.


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Tbruns
Level: Powered On

Re: Help building a flow for Sharepoint Calendar

I am not sure if this is what you mean. If not please let me know.

03-08-2019 1-17-35 PM.jpg

Super User
Super User

Re: Help building a flow for Sharepoint Calendar

Hi @Tbruns , thanks for the output. It has allowed me to see the true names for your values.

Based on the above I propose one of 2 filters to suit. These should copy and paste right in.

 

This one, get's event's that start today only, over a 24 hour period

Start ge @{startOfDay(utcNow(), 'o')} AND Start le @{addHours(startOfDay(utcNow(), 'o'), 24)}

This one, get's the above and also adds in those with an end date of tomorrow's date or later.

Start ge @{startOfDay(utcNow(), 'o')} AND Start le @{addHours(startOfDay(utcNow(), 'o'), 24)} OR EndDate ge @{addHours(startOfDay(utcNow(), 'o'), 24)}

Please try both and see which you feel provides decent results and report back please.

 

If you have found my post helpful, please mark thumbs up.

 

If this post has solved your problem, please click "Accept as Solution".

 

Any other questions, just ask.

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Tbruns
Level: Powered On

Re: Help building a flow for Sharepoint Calendar

I tried both of these individually by copying ans pasting and I get that the expression is invalid.

Super User
Super User

Re: Help building a flow for Sharepoint Calendar

Hi @Tbruns 

 

Try pasting it right in to the "Filter Query" Field. Not as an expression. 

 

If that doesn't work, you'll have to build the filter query.

Do it in the same way you have here:

Capture-356.png

Where you have utcNow(...), add this as an expression:

 

startOfDay(utcNow(), 'o')

Where you have addDays(...) add this as an expression:

 

 

addHours(startOfDay(utcNow(), 'o'), 24)

Thanks, Alan

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Super User
Super User

Re: Help building a flow for Sharepoint Calendar

Hi @Tbruns 

How have you gotten on, have you managed to get it to work?

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Tbruns
Level: Powered On

Re: Help building a flow for Sharepoint Calendar

I was able to get it to work by using the following:

EventDate ge '@{utcNow('yyyy-MM-ddT00:00:00Z')}' and EventDate lt '@{addDays(utcNow(),1,'yyyy-MM-ddT00:00:00Z')}'

View solution in original post

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 296 members 6,126 guests
Please welcome our newest community members: