Published: 02/16/2022
Applies to: Cayosoft Administrator 9.x or later.
Summary: Cayosoft Administrator uses MS Graph API for searching. MS Graph API doesn't support wildcards and 'contains' search, it uses only 'startswith' for the search. This article has two examples of configuring Microsoft 365 web queries to return a list of objects by the part of the name using 'contains'. In the first one, in the result grid post-filtering is used. In the second example, changes should be made per web query in design mode.
Configuration
Example 1
- In Web Portal click web query.
- Set Show to All.
- Search for Objects.
- In the Name column type a search value that contains a part of the object name.
Example 2
This configuration can be applied to the following web queries:
For example, Team names:
Team1 - Community Services - Public
Team2 - Community Services - Private
We need to configure Teams web query that will return all Teams with "Public" or "Private " in their names.
- In Administrator Console navigate to Teams web query.
- Open the Other Query settings section.
- Copy\paste this script to the Initialization Section and replace the Team name search string with your search value:
{if ($MSGraphAdvancedQueries -eq "0")
{
$stokens = @("Private","Public")
$tmp = @()
$stokens | %{ $stoken = $_; $tmp += [string]::Format('"displayName:{0}"', $stoken) }
$searchStr = [string]::Join(" OR ", $tmp)
$global:QueryOptions += @{"`$search"=$searchStr}
}} - Set MS Graph advanced queries to Enabled.
- Enable Design mode.
- On the Query tab open Pre-processing section.
- Move the Initialization data command down after the Prepare data command.
Note: If you are using Administrator Service version 10.1.1 or later, skip this step. It is already included in these versions.
- Save changes.
Comments
0 comments
Please sign in to leave a comment.