cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dennisb88
Super User
Super User

Filter a Microsoft Graph call

Hi all,

 

I'm get calendar items with the graph API, that's working fine. But I try to add a filter in my call.

 

The filter I try to add is that I want only the out of office events. They are showed by the showAs property as 'oof'.

 

So I tried a couple of things, but my flow failed with the error that the filter action is not valid.

I add the follow URI:

 

 

https://graph.microsoft.com/v1.0/users/<EMAILADRES>/calendarView?startDateTime=@{utcNow()}&endDateTime=@{addDays(utcnow(),30)}&$filter=startswith(showAs,'oof')

 

dennisb88_0-1632404444726.png

 

FYI: Without the filter it's working fine.

Does anyone know how I can filter this right?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Dual Super User
Dual Super User

Hi @dennisb88,

 

Have you tried using an equals instead of a startswith. Or do you have a specific requirement that you are using a startswith?

 

https://graph.microsoft.com/v1.0/users/<EMAILADRES>/calendarView?startdateTime=2021-06-15&endDateTime=2021-09-15&$filter=showAs eq 'oof'

View solution in original post

2 REPLIES 2
Expiscornovus
Dual Super User
Dual Super User

Hi @dennisb88,

 

Have you tried using an equals instead of a startswith. Or do you have a specific requirement that you are using a startswith?

 

https://graph.microsoft.com/v1.0/users/<EMAILADRES>/calendarView?startdateTime=2021-06-15&endDateTime=2021-09-15&$filter=showAs eq 'oof'

The eq is working fine! I had not a specific requirement for that! So thank you for helping me out!

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (2,233)