cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

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
Highlighted
Community Support
Community Support

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
Highlighted
Community Support
Community Support

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

Highlighted
Regular Visitor

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
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (8,652)