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

Checking for Events at the same time SharePoint list - temp val failed expected token?

I am trying to create a simple flow that checks if a new item added to a SharePoint calendar overlaps existing items at the same time on the same calendar. 

Condition as such

@and(LessOrEquals(triggerBody()?['EventDate'], item()?['EventDate']),
Less(item()?['EventDate'],triggerBody()?['EndDate'])
),
and(less(triggerBody()?['EventDate'],item()?['EndDate']),
LessOrEquals(item()?['EndDate'],triggerBody()?['EndDate'])
);

 

2018-09-11_19-57-31.jpg

 

But am getting a 

The template validation failed: 'The template action 'Condition_-_is_booking_time_available' at line '1' and column '1739' is not valid: "Unable to parse template language expression 'and(LessOrEquals(triggerBody()?['EventDate'], item()?['EventDate']), Less(item()?['EventDate'],triggerBody()?['EndDate']) ), and(less(triggerBody()?['EventDate'],item()?['EndDate']), LessOrEquals(item()?['EndDate'],triggerBody()?['EndDate']) );': expected token 'EndOfData' and actual 'Comma'.".'. 

 

error.

 

Anyone can point out where I'm making a mistake here?

Many thanks!

1 REPLY 1
Community Support Team
Community Support Team

Re: Checking for Events at the same time SharePoint list - temp val failed expected token?

Hi @Lfloating,

 

Could you share more details on your scenario?

 

Do you want to check whether the start date of the new event less than the start date of an existing event and the end date of a new event is larger than the end date of an existing event?

 

Before the Condition, have you tried to add the action Get items to get all the existing items first then check events?

 

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.

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
Users Online
Currently online: 352 members 5,552 guests
Please welcome our newest community members: