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

Checking calendar for existing events between 2 dates entered

Hi

First post folks  for someone just trying to learn,so be gentle 🙂

Can anyone suggest the best way to check a calendar for any existing appointments between the start date and end date of the new event bing entered.

 

Not really sure of how to even get started with this so any advice or tips to push me in the right direction would be great.

 

Thanks in advance

Martin

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Checking calendar for existing events between 2 dates entered

Hi @MartinC,

 

Do you want to get existing events that start time between the start date and end date of a new event?

 

If yes, please try the following flow for a reference.

 

I add a Condition in the flow and the code is:

@and(greaterorequals(formatDateTime(items('Apply_to_each')?['Start'],'yyyy-MM-dd'), formatDatetime(triggerBody()?['Start'],'yyyy-MM-dd')),lessorequals(formatDateTime(items('Apply_to_each')?['Start'],'yyyy-MM-dd'),formatDatetime(triggerBody()?['End'],'yyyy-MM-dd')))

Note: Make sure the dates are in the same format.

 

When a new event is created, get the existing events, then use the condition to filter out the items that between the start date and end date of the new event.

 

It works fine, please try it on your side.

1.PNG

 

Best regards,

Mabel Mao

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

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Checking calendar for existing events between 2 dates entered

Hi @MartinC,

 

Do you want to get existing events that start time between the start date and end date of a new event?

 

If yes, please try the following flow for a reference.

 

I add a Condition in the flow and the code is:

@and(greaterorequals(formatDateTime(items('Apply_to_each')?['Start'],'yyyy-MM-dd'), formatDatetime(triggerBody()?['Start'],'yyyy-MM-dd')),lessorequals(formatDateTime(items('Apply_to_each')?['Start'],'yyyy-MM-dd'),formatDatetime(triggerBody()?['End'],'yyyy-MM-dd')))

Note: Make sure the dates are in the same format.

 

When a new event is created, get the existing events, then use the condition to filter out the items that between the start date and end date of the new event.

 

It works fine, please try it on your side.

1.PNG

 

Best regards,

Mabel Mao

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

View solution in original post

MartinC
Level: Powered On

Re: Checking calendar for existing events between 2 dates entered

This works for me however Im struggling to show the results , is there an easy way to embed a calendar view or a list of the existing events in an email ?

 

Thanks

M

 

 

Helpful resources

Announcements
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 (Last 30 Days)
Users online (5,757)