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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Office365Outlook V4Cal...
Power Apps
Answered

Office365Outlook V4CalendarGetItems filter by string

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

I am trying to get the Office365Outlook.V4CalendarGetItems to filter events that have a specific keyword (in this case, a project ID). I am getting an invalid filter clause message. Any thoughts on what I need to do differently?


Office365Outlook.V4CalendarGetItems(
ProvCalendar,
{'$filter': "substringof(body, '" & ActiveProject.WorkOrderId & "')"}
).value


ProvCalendar - this is a variable containing the calendar ID. It is correct as it works elsewhere in the app in this function.
ActiveProject.WorkOrderId - this is a variable containing a string with the work order ID that I want to filter for.

I've also tried ActiveProject.WorkOrderId in body with no success either.


Ideally, I'd search subject and body, but I will settle for just one for now as the other should work the same way (or so I am assuming).


Thanks!

Categories:
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Actually, you can try to use Filter() function to filter the events. Please try with this.

    Filter(Office365Outlook.V4CalendarGetItems(ProvCalendar).value, ActiveProject.WorkOrderId in subject || ActiveProject.WorkOrderId in body)

     Hope this helps
    Sik

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you -- and this has been my workaround, but I was trying to offload that to server-side using the built in ODATA filter. Using Filter() in this context seems to pull in all results, then process locally making the app super sluggish. Maybe I am wrong in that assumption, but that is how it appears from user side.

    No one seems to have a good answer for using the ODATA filter, which makes me wonder why they even have it if there is no good documentation for it.

  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    If you want to learn more about Odata filter, please review these blogs Basic Tutorial System Query Option $filter 

    However, the body of event doesn't support filter, reference from here, so the formula returns the error of invalid filter clause.

    Snipaste_2020-08-03_15-32-52.png

     

    In addition, the Subject of event is filterable, and the Contains() function is more suitable, so the odata filter is like this:

     

    Office365Outlook.V4CalendarGetItems(
    ProvCalendar,
    {'$filter': "Contains(subject, '" & ActiveProject.WorkOrderId & "')"}
    ).value

     

    Hope this helps.

    Sik

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard