cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MartinC
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
v-yamao-msft
Community Support
Community Support

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
v-yamao-msft
Community Support
Community Support

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

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,284)