MS Entra – Groups – Get Site
MS Entra – Groups – Get Site
Retrieve the SharePoint site for a group.
Action details
| Property | Value |
|---|---|
| Action label | MS Entra – Groups – Get Site |
| Category | CloudTools |
| Apex class and method | GetEntraGroupSite.getSite |
| Input type | GetEntraGroupSite.GetEntraGroupSiteInput |
| Output type | List<SharePointSite> |
| Authorization | Microsoft 365 connector; supported authorization depends on the endpoint and target. |
| Microsoft Graph request | GET /groups/{groupId}/sites/root |
Prerequisites and permissions
Configure a CloudTools Connector with Connector Type set to Microsoft 365. Complete sign-in for OAuth Delegated (Authorization Code). For supported OAuth Application (Client Credentials) requests, grant application permissions and administrator consent. The identity must have access to the selected resource; directory operations can also require Microsoft Entra roles. Use Creating an Entra ID App and Integration Connectors for setup.
The action permission provider declares these alternatives. They are not cumulative requirements or universally interchangeable; check the Microsoft reference for endpoint, target, and property restrictions.
| Permission type | Declared alternatives |
|---|---|
| Delegated | Sites.Read.All, Sites.ReadWrite.All |
| Application | Sites.Read.All, Sites.ReadWrite.All |
Endpoints: /groups/{groupId}/sites/root.
See the Microsoft operation and permissions reference.
Inputs
| Input | Apex field | Type | Required | Description |
|---|---|---|---|---|
| Group Id | groupId | String | Yes | Group identifier |
| Select | selectQuery | String | No | Comma-separated properties to return |
Supply a nonempty list with a non-null first request. Graph actions process only that first request. Global inputs do not expose connectorId; subscriber Apex and Flow use CloudTools connector selection. Use Microsoft Graph resource IDs or the specifically documented user identifier, and resolve dynamic values before invocation.
Outputs
Returns one mapped SharePointSite inside a list. Check the actual result shape and fields before use.
| Output | Apex field | Type | Description |
|---|---|---|---|
| Id | id | String | Unique identifier for the site |
| Name | name | String | Name of the site |
| Display Name | displayName | String | Display name of the site |
| Description | description | String | Description of the site |
| Web URL | webUrl | String | Web URL of the site |
| Created Date Time | createdDateTime | String | Created date and time for the site |
| Last Modified Date Time | lastModifiedDateTime | String | Last modified date and time for the site |
| Site Collection | siteCollection | SharePointSiteCollection | Site collection metadata for the site |
| SharePoint IDs | sharepointIds | SharePointSiteIds | SharePoint identifier set for the site |
| Root | root | SharePointRootFacet | Indicates the site is a root site |
| Is Personal Site | isPersonalSite | Boolean | Whether the site is a OneDrive personal site |
| ETag | eTag | String | Entity tag for optimistic concurrency |
| OData Type | odataType | String | OData type for the site |
| OData ETag | odataEtag | String | OData ETag for the site |
| Additional Properties | additionalProperties | List<DynamicObject> | Additional properties from user-defined query |
Behavior and limits
Query inputs are passed through or mapped to OData parameters as implemented. Endpoint-specific query support, advanced directory query requirements, and property visibility still apply.
Use in Flow
Use MS Entra – Groups – Get Site where supported. Use a Microsoft 365 application connector configured as Set as default for Flow automations only if the endpoint and target support application access. Supply required values, retain useful outputs, and add fault handling. Delegated connections are not supported for CloudTools Flow automation. The action processes only the first input request.
Use in custom Apex
This subscriber-org example uses the Apptigent namespace. Replace identifiers and example values before use. Configure the connector, complete authorization first, run in a context permitting callouts, and handle exceptions, empty results, and unmapped fields.
Apptigent.GetEntraGroupSite.GetEntraGroupSiteInput request =
new Apptigent.GetEntraGroupSite.GetEntraGroupSiteInput();
request.groupId = 'f11f1340-30b1-4f1d-91ec-c853b7245646';
request.selectQuery = 'id,displayName,webUrl,siteCollection';
List<Apptigent.SharePointSite> results =
Apptigent.GetEntraGroupSite.getSite(
new List<Apptigent.GetEntraGroupSite.GetEntraGroupSiteInput>{ request }
);
System.debug(results);
Use in a Lightning Web Component
Use getEntraGroupSite from msEntraConnectorLib through MSEntraConnectorController. These c/ imports apply in the same namespace. Set request.connectorId for direct MSEntraAction calls. The controller captures the request selection for MSEntraAction.
| Global input | LWC request mapping |
|---|---|
groupId | request.groupId |
selectQuery | request.selectQuery |
entraActionExample.js
import { LightningElement } from 'lwc';
import { getEntraGroupSite } from 'c/msEntraConnectorLib';
export default class EntraActionExample extends LightningElement {
result = null;
errorMessage = '';
isRunning = false;
completed = false;
async handleRun() {
if (this.isRunning || this.completed) return;
this.isRunning = true;
this.errorMessage = '';
try {
const request = { connectorId: 'REPLACE_WITH_CONNECTOR_RECORD_ID' };
request.groupId = 'f11f1340-30b1-4f1d-91ec-c853b7245646';
request.selectQuery = 'id,displayName,webUrl,siteCollection';
this.result = await getEntraGroupSite(request);
this.completed = true;
} catch (error) {
this.errorMessage = error.requiresInteractiveAuthorization
? 'Sign in to Microsoft for the connector, then try again.'
: error.message || 'The Entra action failed.';
} finally {
this.isRunning = false;
}
}
}
entraActionExample.html
<template>
<lightning-button label="Run action" onclick={handleRun}
disabled={isRunning}></lightning-button>
<p role="alert">{errorMessage}</p>
</template>
The library returns one mapped DTO or null. The controller can flatten nested fields, serialize data, or map an action result into an operation DTO. rawJson contains serialized mapped Apex data rather than the untouched Graph response.
Use getMSEntraAuthorizationState, beginMSEntraAuthorization, and createMSEntraOAuthMessageHandler to arrange delegated sign-in. The library normalizes errors but does not automatically sign in or retry. Reset completed for a new deliberate operation, and inspect resource state before retrying a mutation with an uncertain outcome.
Error handling and troubleshooting
| Symptom | What to check |
|---|---|
| Required fields error | Supply a nonempty request list and required or conditionally required inputs. For LWC, use the mapped field names. |
| Authorization or access denied | Check connector selection, sign-in, endpoint/target permission support, administrator consent, directory roles, and resource access. |
| Resource not found | Check Microsoft IDs and parent resource relationships. Preserve group/drive/item associations and mailbox/calendar/event IDs. |
| Missing or unexpected output | Check query support, pagination, wrapper versus item models, public-only properties, and mapped DTO fields. |
| Operation rejected | Inspect the Microsoft error, supported writable fields, group/calendar restrictions, recipient/license data, and file transfer limits. |