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

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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (12,772)