import PortalQueryParams from "@arcgis/core/portal/PortalQueryParams.js";const PortalQueryParams = await $arcgis.import("@arcgis/core/portal/PortalQueryParams.js");- Inheritance:
- PortalQueryParams→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.0
The parameters used to perform a query for Items, Groups, and Users within a Portal.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
| | ||
declaredClass readonly inherited | ||
| | ||
| | ||
| | ||
| | ||
| | ||
"asc" | "desc" | | |
| |
categories
- Since
- ArcGIS Maps SDK for JavaScript 4.8
An array of categories stored within the item. Use this property to filter the results from Portal.queryItems() and PortalGroup.queryItems(). It accepts an array of:
- individual string elements or
- an array of strings.
The query looks at each element within the array and performs a SQL AND operation on them.
If the element is an array instead of a single string element, the elements within this array
are read as OR. See the snippet below:
Note: String[] elements are only supported by ArcGIS Online and version 10.6.1 of Portal for ArcGIS Enterprise.
Example
// Query items with categories tagged as 'Basemaps' OR 'Imagery' AND 'People' OR 'Environment'// i.e. (Basemaps || Imagery) && (People || Environment)params.categories = [["Basemaps", "Imagery"], ["People", "Environment"]]; extent
Only relevant when querying for PortalItems. When specified, restricts the results of the query to the extent defined here.
The spatial reference of the given extent must be WGS84 (wkid 4326) or Web Mercator (wkid 3857).
filter
- Since
- ArcGIS Maps SDK for JavaScript 4.22
Structured filter to use instead of the query property.
- See also
query
The query string used for the search. View the ArcGIS REST API Search Reference for details on constructing a valid query.
- See also
sortField
- Type
- PortalGroupSortField | null | undefined
A comma-delimited list of fields to sort. Field names may vary depending on what is being queried. For example, the fields allowed for a user query are much more limited than if performing a basic search query for portal items. A list of possible field names is listed below. These names correspond to either item (search), group, and/or user queries.
| Field name | Query functionality |
|---|---|
| title | search, group |
| uploaded | search |
| modified | search |
| username | user |
| created | user, group |
| type | search |
| owner | search, group |
| avg-rating | search |
| num-ratings | search |
| num-comments | search |
| num-views | search |
Methods
| Method | Signature | Class |
|---|---|---|
clone(): PortalQueryParams | |
clone
- Signature
-
clone (): PortalQueryParams
Creates a deep clone of the instance of PortalQueryParams that calls this method.
- Returns
- PortalQueryParams
A clone of the instance that called this method.