web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Filter Query - get eve...
Power Automate
Suggested Answer

Filter Query - get events coming up in the next 3 BUSINESS days

(1) ShareShare
ReportReport
Posted on by 38
Hey all,
 
I am trying to figure out how to use the "get events" function to return upcoming events in the next 3 days (ideally business days, but I can work with 3 days). 
 
I have tried so many variations of the filter query however nothing is working! I have tried at least the below variations (and about 15 more). 
 
$filter=Start gt @{body('Convert_Current_Time_')}
Start gt '@{addDays(utcNow(),3,'yyyy-MM-ddTHH:mm:ssZ')}' and End lt '@{addDays(utcNow(),4,'yyyy-MM-ddTHH:mm:ssZ')}' 
$filter=Start gt '@{body('Convert_Current_Time_')}'
Start gt '2024-08-03T23:46:29.6624599Z' and End lt '2024-08-07T23:46:29.6698621Z' 
$filter=Start gt 'utcNow()'
 
Every time I get the same error though: 
 
{
  "status": 400,
  "message": "Invalid filter clause: Syntax error at position 8 in '$filter=Start gt 2024-08-04T00:08:52.0165728Z'.\r\nclientRequestId: 810442d0-3deb-4a61-bc57-12f6f43b28c7\r\nserviceRequestId: 4c8f0622-df71-4db3-90d8-45adbfa45849",
  "error": {
    "message": "Invalid filter clause: Syntax error at position 8 in '$filter=Start gt 2024-08-04T00:08:52.0165728Z'.",
    "code": "BadRequest",
    "originalMessage": "Invalid filter clause: Syntax error at position 8 in '$filter=Start gt 2024-08-04T00:08:52.0165728Z'."
  },
  "source": "office365-ae.azconn-ae-001.p.azurewebsites.net"
}
 
 
All I want to do is get all events that start 3 business days hence (not the events before and not the events after) .
So if I run the flow on Monday, 5 Aug 24) I want to get all events  starting on Thursday, 8 Aug.
Likewise if I run the flow on Thursday, 8 Aug I want to get all events starting on Tuesday, 13 Aug  (3 business days) 
 
 
Can anyone help??
Categories:
I have the same question (0)
  • Suggested answer
    Pstork1 Profile Picture
    68,707 Most Valuable Professional on at
    The first problem is that when you do a Get Events Filter the $filter= is assumed so you don't include that in the filter.  The second problem is that output of your Target date is both Date and Time.  If you are doing that then you need to do a range where the Start is GT Today at Midnight + 2 days or Start is LT Today at Midnight +3 days  
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard