question

VidyadharKurmala-2674 avatar image
0 Votes"
VidyadharKurmala-2674 asked VidyadharKurmala-2674 edited

Microsoft Graph groups API $filter Contains (contains) and $expand transitiveMembers not working

W.r.t documentation aad-advanced-queries I understand $search and $ expand is not supported.. Based on that I tried to use following options $filter Contains(contains) and $expand which is not working as well.

so I would like to know the workable options to read data from transitiveMembers.

Here are few screenshots that are erroring out.

Tried with both $filter=Contains(displayName,'ariba') with $expand and $filter=contains(displayName,'ariba') with $expand.

$filter and $expand:

188807-image.png

$search and $expand

188835-image.png


microsoft-graph-query-parameters
image.png (42.1 KiB)
image.png (40.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

VickyKumarMindtreeConsultingPVTLTD-5545 avatar image
0 Votes"
VickyKumarMindtreeConsultingPVTLTD-5545 answered VickyKumarMindtreeConsultingPVTLTD-5545 edited

Hi ,

Note :
The $filter operator requires advanced query parameters, which are:
ConsistencyLevel=eventual header
$count=true query string

188987-filter.png
Doc - https://docs.microsoft.com/en-us/graph/aad-advanced-queries?tabs=http#group-properties

Could you please try by using "Startwith" in place of "Contains" , please see the below API
URL - https://graph.microsoft.com/beta/groups?filter=startsWith(displayName, 'ariba')&$expand=transitiveMemberOf

Hope you are expecting the same result.



filter.png (32.1 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

0 Votes 0 ·
VidyadharKurmala-2674 avatar image
0 Votes"
VidyadharKurmala-2674 answered VidyadharKurmala-2674 edited

Hi!

Thank you for your reply, however startsWith doesn't fit here.

displayName doesn't accept contains w.r.t this link https://docs.microsoft.com/en-us/graph/aad-advanced-queries?view=graph-rest-1.0&tabs=http

189266-image.png

here is a screenshot with filter contains and count = true.

https://graph.microsoft.com/v1.0/groups?$filter=contains(displayName,'ariba')&$count=true&$expand=transitiveMembers($select =displayName,onPremisesSamAccountName)&$select=displayName,description

189319-image.png



I already tried startsWith, however the requirement is to get the group names that contains Ariba keyword, so the options are either to use contains or search with $expand to get the group information along with transitiveMembers.


When we go with startsWith, we will miss the records that have Ariba in the middle of group i.e. "Contractor Ariba Users".

There is a way to fulfill the requirement, however this will definitely degrades the performance.
Here are the steps to follow:
1) First call: get all group names that has Ariba keyword using https://graph.microsoft.com/v1.0/groups?$search="displayName:ariba"
2) Loop through each record and call the second API https://graph.microsoft.com/v1.0/groups/{id}/transitiveMembers

so let's wait and see if we get any feasible solution on this requirement.



image.png (19.5 KiB)
image.png (41.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.