Skip to main content
Community site session details

Community site session details

Session Id : bRUGGWWiR75M1OQMYlQp01
Power Automate - Building Flows
Answered

Using $filter on GetEvents not working

Like (0) ShareShare
ReportReport
Posted on 14 Sep 2022 02:19:56 by 21

Hi! I'm trying to build a flow that gets the days events from the authenticated user, match on the subject, and if it doesn't exist create it, and if it does exit.

We're trying to build it so it helps run on schedule so that people can have calendar entries made automatically - but also not double, triple, etc. up if that entry already exists.

At the moment I'm testing with a push button trigger, that goes into the "Get events (v4)" action.

In the Get Events I have the following: 

Calendar ID: Calendar
Filter query: (subject eq 'MYSUBJECT') AND (start gt 'formatDateTime(utcNow(), 'yyyy-MM-dd"T"22:00:00.0000000Z')') AND (end lt 'formatDateTime( addDays(utcNow(), 1), 'yyyy-MM-dd"T"08:00:00.0000000Z')')

However when I run this I get the following error: "Invalid filter clause"

If I only search for the (subject eq 'MYSUBJECT') then I get the results, but there doesn't seem to be a way to filter on dateTime.

The output when matching only on the subject is the following:

"statusCode": 200,

"body": {
"value": [
{
"subject": "MYSUBJECT",
"start": "2022-09-12T22:00:00.0000000",
"end": "2022-09-12T23:00:00.0000000",
"startWithTimeZone": "2022-09-12T22:00:00+00:00",
"endWithTimeZone": "2022-09-12T23:00:00+00:00",
"body": "...",
"isHtml": true,
"responseType": "organizer",
"responseTime": "0001-01-01T00:00:00+00:00",
"id": "...",
"createdDateTime": "2022-09-13T10:26:27.6613388+00:00",
"lastModifiedDateTime": "2022-09-13T10:26:34.552403+00:00",
"organizer": "...",
"timeZone": "UTC",
"iCalUId": "...",
"categories": [],
"webLink": "...",
"requiredAttendees": "",
"optionalAttendees": "",
"resourceAttendees": "",
"location": "",
"importance": "normal",
"isAllDay": false,
"recurrence": "none",
"reminderMinutesBeforeStart": 15,
"isReminderOn": false,
"showAs": "busy",
"responseRequested": true,
"sensitivity": "normal"
}
]
}
}

  • __markb Profile Picture
    21 on 15 Sep 2022 at 01:03:45
    Re: Using $filter on GetEvents not working

    Thank you! That worked

  • Verified answer
    v-xiaochen-msft Profile Picture
    on 14 Sep 2022 at 06:20:31
    Re: Using $filter on GetEvents not working

    Hi @__markb ,

     

    I researched for a while and found that the root cause was the field name.

    Please use Start/DateTime instead of using start. End was the same.

    vxiaochenmsft_0-1663136339125.png

     

    Best Regards,

    Wearsky

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Loading complete