cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ahlbornj
New Member

Flow to get employees off for next day

Hi!

 

I am attempted to create a flow which goes into my OOF calendar on my sharepoint site and gathers all the employees listed for the next day. I want this to run at 9am and send an automated email to the supervisor with the employees off for the next day, but ran into some issues with the dynamic input within the filter array action. 

@and(
 greaterorequals(adddays(utcnow(),1,'yyyy-MM-dd'),formatDateTime(item()?['EventDate'],'yyyy-MM-dd')),
lessorequals(adddays(utcnow(),1,'yyyy-MM-dd'),formatDateTime(item()?['EndDate'],'yyyy-MM-dd'))
)

This is what I am currently using but for some reason the email i get is just a list of all the holidays for the year. Anybody have any idea how i could fix this?

 

Thanks!

2 REPLIES 2
ScottShearer
Super User
Super User

@ahlbornj:

 

I suggest using an Exchange shared calendar or a Teams/Group calendar rather than a SharePoint calendar for this purpose.  The reason is that getting the data you want from the calendar is much more complicated that you might think.  One reason for the complexity is how SharePoint stores calendar information for repeating events.

 

If you use an exchange-based calendar, the supervisor could just add the calendar to Outlook.  In addition, you may be able to add the Team/Group calendar to the SharePoint site.

 

If you elect to stay with a SharePoint calendar, your best bet may be to use the HTTP action for SharePoint and make a call to retrieve the calendar info.  You can then format the data received and send out in an email.

 

Scott

 

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
v-bacao-msft
Community Support
Community Support

Hi @ahlbornj,

 

I use your formula on my side to filter out the next day's data, but I don't specify the Category Type. You can add one more condition to the formula:

@and(equals(item()?['Category']?['Value'], 'Holiday'),greaterorequals(adddays(utcNow(),1,'yyyy-MM-dd'),formatDateTime(item()?['EventDate'],'yyyy-MM-dd')),
lessorequals(adddays(utcNow(),1,'yyyy-MM-dd'),formatDateTime(item()?['EndDate'],'yyyy-MM-dd')))

 

As for the email you said, it shows a whole year of data, it may be that the value you used when configuring Create Html table action is from Get items action.

Please use the value of Filter array output to be configured in Create html table action.

Please take a try again.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,794)