Complex Queries with Microsoft graph on SharePoint

New Contributor

I have been trying to replicate my PowerApps function filter on Microsoft graph. Using the Graph API for SharePoint documentation. However, I am unable to group the various queries as seen below. I have not found any MS article on multiple queries. 



PowerApps Query =>      MeetingRoom=selectedRoom && ((ArrivalDateAndTime<=selectedStart && ArrivalEndDateAndTime>selectedStart) || ((ArrivalDateAndTime<selectedEnd && ArrivalEndDateAndTime>selectedEnd) || (ArrivalEndDateAndTime>selectedStart && ArrivalEndDateAndTime<=selectedEnd))



I have been able to do this that's the first part of the query and it works ( as seen below).


MeetingRoom eq 'General Board Room'


However, I have the rest of the query to complete and MS graph does not accept brackets '(' ')'

I have written what I believe the query should be like, with the brackets. 


and (

(fields/ArrivalDateAndTime<=2021-07-30T06:41:30Z and fields/ArrivalEndDateAndTime>2021-07-30T06:41:30Z)


(fields/ArrivalDateAndTime<2021-09-30T06:41:30Z and fields/ArrivalEndDateAndTime>2021-09-30T06:41:30Z)


(fields/ArrivalEndDateAndTime>2021-07-30T06:41:30Z and fields/ArrivalEndDateAndTime<=2021-09-30T06:41:30Z)





Graph Query 1=>$expand=fields&$filter=fields/MeetingRoom eq 'General Board Room' and fields/MeetingRoom eq 'Bar'



Please how do I group these queries?

1 Reply
best response confirmed by Chuksobi (New Contributor)
I have gotten around this as the endpoint accepts brackets '(' ')' for multiple grouping. My query had an invalid character.