Graph API search for missing extension

Viewed 94

So we use some custom extension attributes and our B2C and we are trying to filter on some missing data.

https://graph.microsoft.com/beta/users?$count=true&$filter=CustomExtension eq 'blah'

Im using beta simply for the ease of seeing the data.

However, come to find out doing my research that the customextension does not get applied to the B2C account.

Is there a way to use the filter to look for custom extensions that are NOT on the users accounts?

I need a count of all the users that do not have this customextension.

1 Answers

If the custom attribute is created using the B2C users' portal then the custom attribute should looks something like "extension_<AttributeName>" and if its created using MS Graph APIs in the B2C tenant, then it custom attribute would look something like "extension_<b2c-extensions-app-guid>_<AttributeName>".

Can you please try create a filter something like:

https://graph.microsoft.com/v1.0/users/?$select=displayName,id,extension_10a6691fcea1415cb0836f5d9f423d55_TShirtSize&$filter=startswith(extension_10a6691fcea1415cb0836f5d9f423d55_TShirtSize, 'L')

This is a sample query, that I had used to list all users who has a custom attribute TShirtSize with a value of 'L'.

Related