Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Class: PortalGroup

require(["esri/arcgis/Portal"], function(arcgisPortal) { /* code goes here */ });

Description

(Added at v2.8)
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, then all members of the organization will be able to find the group. View the ArcGIS Portal API REST documentation for the Group for more details.

Samples

Search for samples that use this class.

Properties

NameTypeSummary
accessStringThe access privileges on the group which determines who can see and access the group.
createdDateThe date the group was created.
descriptionStringA detailed description of the group.
idStringThe id for the group.
isInvitationOnlyBooleanIf this is set to true, then users will not be able to apply to join the group.
isViewOnlyBooleanDenotes a view only group where members are not able to share items.
modifiedDateThe date the group was last modified.
ownerStringThe username of the group's owner.
portalPortalThe portal for the group.
snippetStringA short summary that describes the group.
tagsString[]User defined tags that describe the group.
thumbnailUrlStringThe url to the thumbnail used for the group.
titleStringThe title for the group.
urlStringThe url to the group.

Methods

NameReturn typeSummary
getMembers()DeferredGet the current members for the group.
getThumbnailUrl(width?)StringGet the URL to the thumbnail image for the portal group.
queryItems(queryParams?)DeferredExecute a query against the group to return a deferred that when resolved returns PortalQueryResult that contain a results array of PortalItem objects that match the input query.
Property Details

<String> access

The access privileges on the group which determines who can see and access the group. Can be: private, org, or public.

<Date> created

The date the group was created.

<String> description

A detailed description of the group.

<String> id

The id for the group.

<Boolean> isInvitationOnly

If this is set to true, then users will not be able to apply to join the group.
Known values: true | false

<Boolean> isViewOnly

Denotes a view only group where members are not able to share items. (Added at v3.4)
Known values: true | false
Default value: false

<Date> modified

The date the group was last modified.

<String> owner

The username of the group's owner.

<Portal> portal

The portal for the group.

<String> snippet

A short summary that describes the group.

<String[]> tags

User defined tags that describe the group.

<String> thumbnailUrl

The url to the thumbnail used for the group.

<String> title

The title for the group. This is the name that is displayed to users and by which they refer to the group. Every group must have a title and it must be unique for a user.

<String> url

The url to the group.
Method Details

getMembers()

Get the current members for the group. Returns a deferred that when resolved provides access to a the Object listed below in the Object Specifications table. Provides access to list the users, owner and administrator of a group. Only available to members or administrators of the group. View the ArcGIS Portal API REST documentation for the Group Users for more details.
Return type: Deferred
Object Specifications:
<Object>
<String[]> admins Required An array containing the user names for each administrator of the group.
<String> owner Required The user name of the owner of the group.
<String[]> users Required An array containing the user names for each user in the group.
Sample:
require([
  "dojo/_base/array", ... 
], function(array, ... ) {
  portalGroup.getMembers().then(function(members){
    array.forEach(members.admins,function(admin){
      console.log(admin);
    });        
  });
  ...
});

getThumbnailUrl(width?)

Get the URL to the thumbnail image for the portal group.

Available width sizes: 150, 300 and 600. (Added at v3.21)
Return type: String
Parameters:
<Number> width Optional The desired image width.

queryItems(queryParams?)

Execute a query against the group to return a deferred that when resolved returns PortalQueryResult that contain a results array of PortalItem objects that match the input query.
Return type: Deferred
Parameters:
<Object> queryParams Optional The input query parameters.
Object Specifications:
<queryParams>
<Number> num Required The maximum number of results to be included in the result set response. The Default value is 10 and the maximum allowed value is 100. The start parameter combined with the num parameter can be used to paginate the search results. Note that the actual number of returned results may be less than num if the number of results remaining after start is less than num.
<String> q Required The query string used for a search. View the ArcGIS REST API Search Reference for details on constructing a valid query.
<String> sortField Required A comma separated list of field(s) to sort by. Valid fields are: title, created, type, owner, avgRating, numRatings, numComments and numViews.
<Number> start Required The number of the first entry in the result set response. The index number is 1-based. The start parameter, along with the num parameter can be used to paginate the search results.
Show Modal