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

The group resource represents a group within the Portal. A group resource represents a group (e.g., "San Bernardino Fires"). The visibility of the group to other users is determined by the access property. If the group is private, no one except the administrators and the members of the group will be able to see it. If the group is shared with an organization, than all members of the organization are able to find the group. For additional information, see the ArcGIS REST API documentation for Group.

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.

access

Property
Type
"private" | "org" | "public" | null | undefined

The access privileges on the group which determines who can see and access the group.

created

autocast Property
Type
Date | null | undefined

The date the group was created.

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.

description

Property
Type
string | null | undefined

A detailed description of the group.

id

Property
Type
string | null | undefined

The unique id for the group.

isInvitationOnly

Property
Type
boolean

If set to true, then users will not be able to apply to join the group.

Default value
false

modified

autocast Property
Type
Date | null | undefined

The date the group was last modified.

owner

Property
Type
string | null | undefined

The username of the group's owner.

portal

Property
Type
Portal | null | undefined

The portal associated with the group.

snippet

Property
Type
string | null | undefined

A short summary that describes the group.

sourceJSON

Property
Type
any
Since
ArcGIS Maps SDK for JavaScript 4.28

The JSON used to create the property values when the PortalGroup is created. Although most commonly used properties are exposed on the PortalGroup class directly, this provides access to all information returned for the portal group. This property is useful if working in an application built using an older version of the API which requires access to a portal's group properties from a more recent version.

See also

tags

Property
Type
string[] | null | undefined

User defined tags that describe the group.

thumbnailUrl

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

The URL to the thumbnail used for the group.

See also

title

Property
Type
string | null | undefined

The title of the group. This is the name that is displayed to users. It is also used to refer to the group. Every group must have a title and it must be unique.

url

readonly Property
Type
string | null | undefined

The URL to the group.

Methods

MethodSignatureClass
fromJSON
inherited static
fromJSON(json: any): any
fetchCategorySchema(options?: AbortOptions | null | undefined): Promise<object[]>
fetchMembers(options?: AbortOptions | null | undefined): Promise<Members>
getThumbnailUrl(width?: number): string | null | undefined
queryItems(queryParams?: PortalQueryParamsProperties, options?: AbortOptions | null | undefined): Promise<PortalQueryResult<PortalItem>>
toJSON
inherited
toJSON(): any

fromJSON

inheritedstatic Method
Signature
fromJSON (json: any): any
Inherited from: JSONSupportMixin

Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. The object passed into the input json parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.

Parameters
ParameterTypeDescriptionRequired
json
any

A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.

Returns
any

Returns a new instance of this class.

fetchCategorySchema

Method
Signature
fetchCategorySchema (options?: AbortOptions | null | undefined): Promise<object[]>
Since
ArcGIS Maps SDK for JavaScript 4.8

If present, fetches the group's category schema.

Parameters
ParameterTypeDescriptionRequired
options

An object with the following properties.

Returns
Promise<object[]>

Resolves to an array of objects containing the following properties:

PropertyTypeDescription
titlestringThe title of the category schema.
categoriesobject[]An array of objects containing a title and an optional array of subcategories.
Example
// Fetch featured group members
portal.fetchFeaturedGroups().then(function(groups){
groups.forEach(function(group){
// Fetch group category schema
group.fetchCategorySchema().then(function(schemas){
schemas.forEach(function(schema){
console.log("schema: ", schema);
})
});
});
});

fetchMembers

Method
Signature
fetchMembers (options?: AbortOptions | null | undefined): Promise<Members>

Fetches the current members of the group. This method is only available to members or administrators of the group. View the ArcGIS REST API documentation for the Group Users for more details.

Parameters
ParameterTypeDescriptionRequired
options

An object with the following properties.

Returns
Promise<Members>

Resolves to an object with the members of the group.

Example
// Fetch featured group members
portal.fetchFeaturedGroups().then(function(groups){
groups.forEach(function(group){
group.fetchMembers().then(function(members){
console.log("member", members);
});
});
});

getThumbnailUrl

Method
Signature
getThumbnailUrl (width?: number): string | null | undefined
Since
ArcGIS Maps SDK for JavaScript 4.4

Get the URL to the thumbnail image for the group.

Available width sizes: 150, 300 and 600.

Parameters
ParameterTypeDescriptionRequired
width

The desired image width.

Returns
string | null | undefined

The URL to the thumbnail image.

queryItems

Method
Signature
queryItems (queryParams?: PortalQueryParamsProperties, options?: AbortOptions | null | undefined): Promise<PortalQueryResult<PortalItem>>

Executes a query against the group to return an array of PortalItem objects that match the input query.

Parameters
ParameterTypeDescriptionRequired
queryParams

The input query parameters defined in PortalQueryParams.

options

An object with the following properties.

Returns
Promise<PortalQueryResult<PortalItem>>

When resolved, resolves to an instance of PortalQueryResult which contains a results array of PortalItem objects representing all the items that match the input query.

toJSON

inherited Method
Signature
toJSON (): any
Inherited from: JSONSupportMixin

Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.

Returns
any

The ArcGIS portal JSON representation of an instance of this class.