Skip to content
import PortalQueryParams from "@arcgis/core/portal/PortalQueryParams.js";
Inheritance:
PortalQueryParamsAccessor
Since
ArcGIS Maps SDK for JavaScript 4.0

The parameters used to perform a query for Items, Groups, and Users within a Portal.

See also

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.

categories

Property
Type
Array<string | string[]> | null | undefined
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"]];

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor
Since
ArcGIS Maps SDK for JavaScript 4.7

The name of the class. The declared class name is formatted as esri.folder.className.

extent

autocast Property
Type
Extent | null | undefined

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

Property
Type
string | null | undefined
Since
ArcGIS Maps SDK for JavaScript 4.22

Structured filter to use instead of the query property.

See also

num

Property
Type
number

The maximum number of results to be included in the result set response. The maximum value allowed is 100. The start property combined with the num property can be used to paginate the search results.

Default value
10

query

Property
Type
string | null | undefined

The query string used for the search. View the ArcGIS REST API Search Reference for details on constructing a valid query.

See also

sortField

Property
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 nameQuery functionality
titlesearch, group
uploadedsearch
modifiedsearch
usernameuser
createduser, group
typesearch
ownersearch, group
avg-ratingsearch
num-ratingssearch
num-commentssearch
num-viewssearch
See also

sortOrder

Property
Type
"asc" | "desc"

The order in which to sort the results.

Possible ValueDescription
ascSort the results in ascending order.
descSort the results in descending order.
Default value
"asc"

start

Property
Type
number

The index of the first entry in the result set response. The index is 1-based. The start property, along with the num property can be used to paginate the search results.

Default value
1

Methods

MethodSignatureClass
clone(): PortalQueryParams

clone

Method
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.