Azure Development

Exploring MS Graph API: Error – “Too many child clauses…”

I have a list of emails, which are UPNs (user principal name), which I am using in a query filter to retrieve an information for Azure AD users.

Honestly, I was exploring, trying to figure out the best way to query, knowing that IN {} statement is not supported for the filter. What is supported?

Also, I was testing for the URL length limitation.

Currently, I have only two users in my AD, so,  basically, my query looks like with lots of repeatitions:

https://graph.microsoft.com/v1.0/users?$select=id, displayName, userPrincipalName&$filter=userPrincipalName eq ‘Louis@PearsonSpecter.onmicrosoft.com’ or
userPrincipalName eq ‘Quang@PearsonSpecter.onmicrosoft.com’ or userPrincipalName eq ‘Louis@PearsonSpecter.onmicrosoft.com’ or
userPrincipalName eq ‘Quang@PearsonSpecter.onmicrosoft.com’or userPrincipalName eq ‘Louis@PearsonSpecter.onmicrosoft.com’ or
userPrincipalName eq ‘Quang@PearsonSpecter.onmicrosoft.com’or userPrincipalName eq ‘Louis@PearsonSpecter.onmicrosoft.com’ or
userPrincipalName eq ‘Quang@PearsonSpecter.onmicrosoft.com’or userPrincipalName eq ‘Louis@PearsonSpecter.onmicrosoft.com’ or
userPrincipalName eq ‘Quang@PearsonSpecter.onmicrosoft.com’or userPrincipalName eq ‘Louis@PearsonSpecter.onmicrosoft.com’ or
userPrincipalName eq ‘Quang@PearsonSpecter.onmicrosoft.com’or userPrincipalName eq ‘Louis@PearsonSpecter.onmicrosoft.com’ or
userPrincipalName eq ‘Quang@PearsonSpecter.onmicrosoft.com’or userPrincipalName eq ‘Louis@PearsonSpecter.onmicrosoft.com’ or
userPrincipalName eq ‘Quang@PearsonSpecter.onmicrosoft.com’

Opps! I didn’t know that. Did you?

Max allowed is 10. Now we know 🙂

msgraphquerylimitation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s