I use the below query to list all Microsoft 365 groups from our tenant. I would like to add one more filter so that it should only return the groups which have a guest member (Usertype eq 'Guest') in it. Could someone please help
https://graph.microsoft.com/v1.0/groups?$filter=groupTypes/any(c:c+eq+'Unified')
Unfortunately there is no such filter to do what you are proposing, you will have to get a list of groups, then use that to query the List members endpoint /groups/{id}/members https://learn.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0&tabs=http . then make your own list.
so to summarize, first run your query, get the guids for each group, then grab the members from each group and do some filtering on the client side for usertype.
In theory group/members filtering is possible as of a few weeks ago, with a query like this: https://graph.microsoft.com/beta/groups/{id}/members?$count=true&$filter=UserType eq 'Guest'
https://microsoftgraph.uservoice.com/forums/920506-microsoft-graph-feature-requests/suggestions/35630488-enable-filter-on-group-members#%7Btoggle_previous_statuses%7D
note that you need to put in a custom request header of consistencylevel as per the docs.
Related
I am following this post:
http://pawansatope.blogspot.com/2012/01/how-to-create-count-related-lookup.html
Now I want to get the same results(i.e DepartmentTitle and NbOfEmployees) values programatically using the REST api.
I've tried different variations of:
/items$select=Title,NbOfEmployees/...&$expand=NbOfEmployees
but haven't got any luck.
Has anyone tried this?
Many thanks!
I created the lookup field "NbOfEmployees" (Department(Count Related) to Employee Data list like this:
This is the two list data:
Then for NbOfEmployees field (Department count), directly get in Rest API:
http://sp2016/_api/web/lists/getbyTitle('Department')/items?$select=NbOfEmployeesId,Title
Actually, this value is the real count value for department, no need to expand in Rest.
I have two entities Properties and Bookings.
I need to know the URL structure in case I'm filtering the properties base on query on bookings.
In my case I need to get the properties which are free (not occupied) at specific date.
Can it be
api/properties/free/{date}
Or
api/properties/bookings?bookingDate!='1-1-2017'
Or
api/properties?bookingDate!='1-1-2017'
it seems for me that the last one is the more appropriate but the filter is on the bookings not on the properties which is not obvious.
The Facebook Graph API has a interesting way of doing nested queries by using a strategy of fields filter.
The fields filter it´s a way of filter specific fields or nested fields of a rouserce. They also create a standard way to inform functions for every selected field like: limit or equal.
Your request would be something like this:
GET /api/properties?fields=bookings{bookingDate.notEqual('1-1-2017')}
For more information about Facebook´s GraphAPI:
https://developers.facebook.com/docs/graph-api/overview/
Is there a way to query work items where a user was mentioned? I am able to receive 'hard-coded' results by querying for
"History"-"Contains word"-"\#Username",
but I want a generic version, which works for all users. (Opposed to writing one query for every user)
Use this predicate:
Field: "ID"
Operator: "In"
Value: "#RecentMentions"
This automatically filters for work items, where current user has been mentioned.
I found it in predefined filter "Mentioned" in "Work Items" section. If you click on "Open in Queries" button, you will get a query with above filter. (This section can even remove the need for that query...)
Note: at present time, works only in VSTS.
https://{org}.visualstudio.com/{project}/_workitems/mentioned/
This would achieve the same result.
There is no way to achieve this by work item query directly just as starain mentioned. You can create a custom hub or custom widget by using VSTS Extension to show these information in web portal.
You can’t achieve that through work item query directly, you could build a app to retrieve data through REST API (https://www.visualstudio.com/en-us/docs/integrate/api/wit/wiql), change query text according different conditions (e.g. users)
Your query should be something like this
Select Id,Title From WorkItems Where ID IN (#RecentMentions) order by [System.ChangedDate] desc
here is the reference for rest of the macro's available in ADO rest API.
https://learn.microsoft.com/en-us/azure/devops/boards/queries/query-operators-variables?view=azure-devops
I'm trying to find all messages that have a non-empty category list, using Office 365 REST API, using the following request:
/api/v2.0/me/messages?$search=%22Categories:-[]%22
This doesn't seem to work though: it returns an empty result set. When I run the same query in Outlook 2016 UI, it does return results.
Is it not supported or is their something wrong with the query?
As my test, using the following format can get the non-empty category list.
endpointUri + "/Me/Messages?$search=%22category:%22".
The search field is 'category', and add nothing behind the colon. Hope it helps.
I'm trying to build a LDAP query that searches for groups that are owned (multivalued attribute) by a particular user and nobody else.
Simple Exp:
Group A: Owners [Bob, Joe, Bill]
Group B: Owners [Bob]
Group C: Owners [Carl]
Only group b should be returned by this query if I was looking for Bob. My current query pulls all groups where a named person is an owner then I'm using Perl to loop through the results and find what I need, but it seems a little inefficient. Any pointers or suggestions would be appreciated.
You can't. There is no LDAP filter syntax that can possibly accomplish that. See RFC 2254. This is a very strange design. It doesn't map not LDAP can do at all.