PortalGroup

AMD: require(["esri/portal/PortalGroup"], (PortalGroup) => { /* code goes here */ });
ESM: import PortalGroup from "@arcgis/core/portal/PortalGroup.js";
Class: esri/portal/PortalGroup
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

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Show inherited properties Hide inherited properties
Name Type Summary Class

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

PortalGroup

The date the group was created.

PortalGroup

The name of the class.

Accessor

A detailed description of the group.

PortalGroup

The unique id for the group.

PortalGroup

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

PortalGroup

The date the group was last modified.

PortalGroup

The username of the group's owner.

PortalGroup

The portal associated with the group.

PortalGroup

A short summary that describes the group.

PortalGroup

The JSON used to create the property values when the PortalGroup is created.

PortalGroup

User defined tags that describe the group.

PortalGroup

The URL to the thumbnail used for the group.

PortalGroup

The title of the group.

PortalGroup

The URL to the group.

PortalGroup

Property Details

access

Property
access String

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

Possible Values:"private" |"org" |"public"

created

Property
created Date

The date the group was created.

declaredClass

Inherited
Property
declaredClass Stringreadonly
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.7 Accessor since 4.0, declaredClass added at 4.7.

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

description

Property
description String

A detailed description of the group.

id

Property
id String

The unique id for the group.

isInvitationOnly

Property
isInvitationOnly Boolean

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

Default Value:false

modified

Property
modified Date

The date the group was last modified.

owner

Property
owner String

The username of the group's owner.

portal

Property
portal Portal

The portal associated with the group.

snippet

Property
snippet String

A short summary that describes the group.

sourceJSON

Property
sourceJSON Object
Since: ArcGIS Maps SDK for JavaScript 4.28 PortalGroup since 4.0, sourceJSON added at 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.

tags

Property
tags String[]

User defined tags that describe the group.

thumbnailUrl

Property
thumbnailUrl Stringreadonly
Since: ArcGIS Maps SDK for JavaScript 4.4 PortalGroup since 4.0, thumbnailUrl added at 4.4.

The URL to the thumbnail used for the group.

title

Property
title String

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

Property
url Stringreadonly

The URL to the group.

Method Overview

Show inherited methods Hide inherited methods
Name Return Type Summary Class

Adds one or more handles which are to be tied to the lifecycle of the object.

Accessor
Promise<Object[]>

If present, fetches the group's category schema.

PortalGroup
Promise<Object>

Fetches the current members of the group.

PortalGroup

Get the URL to the thumbnail image for the group.

PortalGroup

Returns true if a named group of handles exist.

Accessor

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

PortalGroup

Removes a group of handles owned by the object.

Accessor

Method Details

addHandles

Inherited
Method
addHandles(handleOrHandles, groupKey)
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, addHandles added at 4.25.

Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.

// Manually manage handles
const handle = reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
);

this.addHandles(handle);

// Destroy the object
this.destroy();
Parameters
handleOrHandles WatchHandle|WatchHandle[]

Handles marked for removal once the object is destroyed.

groupKey *
optional

Key identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.

fetchCategorySchema

Method
fetchCategorySchema(options){Promise<Object[]>}
Since: ArcGIS Maps SDK for JavaScript 4.8 PortalGroup since 4.0, fetchCategorySchema added at 4.8.

If present, fetches the group's category schema.

Parameters
options Object
optional

An object with the following properties.

Specification
signal AbortSignal
optional

Signal object that can be used to abort the asynchronous task. The returned promise will be rejected with an Error named AbortError when an abort is signaled. See also AbortController for more information on how to construct a controller that can be used to deliver abort signals.

Returns
Type Description
Promise<Object[]> Resolves to an array of objects containing the following properties:
Property Type Description
title string The title of the category schema.
categories object[] 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
fetchMembers(options){Promise<Object>}

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
options Object
optional

An object with the following properties.

Specification
signal AbortSignal
optional

Signal object that can be used to abort the asynchronous task. The returned promise will be rejected with an Error named AbortError when an abort is signaled. See also AbortController for more information on how to construct a controller that can be used to deliver abort signals.

Returns
Type Description
Promise<Object> Resolves to an object with the following properties:
Property Type Description
admins String[] An array containing the user names for each administrator of the group.
owner String The user name of the owner of the group.
users String[] An array containing the user names for each user in 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
getThumbnailUrl(width){String}
Since: ArcGIS Maps SDK for JavaScript 4.4 PortalGroup since 4.0, getThumbnailUrl added at 4.4.

Get the URL to the thumbnail image for the group.

Available width sizes: 150, 300 and 600.

Parameter
width Number
optional

The desired image width.

Returns
Type Description
String The URL to the thumbnail image.

hasHandles

Inherited
Method
hasHandles(groupKey){Boolean}
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, hasHandles added at 4.25.

Returns true if a named group of handles exist.

Parameter
groupKey *
optional

A group key.

Returns
Type Description
Boolean Returns true if a named group of handles exist.
Example
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
  obj.removeHandles("watch-view-updates");
}

queryItems

Method
queryItems(queryParams, options){Promise<PortalQueryResult>}

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

Parameters
optional
Autocasts from Object

The input query parameters defined in PortalQueryParams.

options Object
optional

An object with the following properties.

Specification
signal AbortSignal
optional

Signal object that can be used to abort the asynchronous task. The returned promise will be rejected with an Error named AbortError when an abort is signaled. See also AbortController for more information on how to construct a controller that can be used to deliver abort signals.

Returns
Type Description
Promise<PortalQueryResult> 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.

removeHandles

Inherited
Method
removeHandles(groupKey)
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, removeHandles added at 4.25.

Removes a group of handles owned by the object.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.