MS Entra – Groups – Get Folder Items

Estimated reading: 9 minutes

MS Entra – Groups – Get Folder Items

Get items in a group document library folder.

Action details

PropertyValue
Action labelMS Entra – Groups – Get Folder Items
CategoryCloudTools
Apex class and methodGetEntraGroupLibraryItemChildren.getLibraryItemChildren
Input typeGetEntraGroupLibraryItemChildren.GetEntraGroupLibraryItemChildrenInput
Output typeList<List<MSGraphDriveItem>>
AuthorizationMicrosoft 365 connector; supported authorization depends on the endpoint and target.
Microsoft Graph requestGET /groups/{groupId}/drives/{driveId}/root/children or /groups/{groupId}/drives/{driveId}/items/{itemId}/children

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 typeDeclared alternatives
DelegatedFiles.Read, Files.ReadWrite, Files.Read.All, Files.ReadWrite.All, Sites.Read.All, Sites.ReadWrite.All
ApplicationFiles.Read.All, Files.ReadWrite.All, Sites.Read.All, Sites.ReadWrite.All

Endpoints: /groups/{groupId}/drives/{driveId}/root/children or /groups/{groupId}/drives/{driveId}/items/{itemId}/children. File and site scopes depend on the resource and tenant policy.

See the Microsoft operation and permissions reference.

Inputs

InputApex fieldTypeRequiredDescription
Group IdgroupIdStringYesGroup identifier
Library IddriveIdStringYesLibrary (drive) identifier
Item IditemIdStringNoLibrary (drive) item identifier. Leave blank for root folder.
SelectselectQueryStringNoComma-separated properties to return
ToptopQueryStringNoNumber of items to return
Order ByorderbyQueryStringNoComma-separated properties to sort by

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 an outer list containing one resource collection. It is not one collection for every input request. A null response or unmapped value produces an empty inner collection.

OutputApex fieldTypeDescription
ididStringMapped drive item property; populated only when returned and supported by the resource.
namenameStringMapped drive item property; populated only when returned and supported by the resource.
descriptiondescriptionStringMapped drive item property; populated only when returned and supported by the resource.
createdDateTimecreatedDateTimeStringMapped drive item property; populated only when returned and supported by the resource.
lastModifiedDateTimelastModifiedDateTimeStringMapped drive item property; populated only when returned and supported by the resource.
createdBycreatedByMSGraphDriveIdentitySetMapped drive item property; populated only when returned and supported by the resource.
lastModifiedBylastModifiedByMSGraphDriveIdentitySetMapped drive item property; populated only when returned and supported by the resource.
webUrlwebUrlStringMapped drive item property; populated only when returned and supported by the resource.
webDavUrlwebDavUrlStringMapped drive item property; populated only when returned and supported by the resource.
sizesizeLongMapped drive item property; populated only when returned and supported by the resource.
eTageTagStringMapped drive item property; populated only when returned and supported by the resource.
cTagcTagStringMapped drive item property; populated only when returned and supported by the resource.
odataTypeodataTypeStringMapped drive item property; populated only when returned and supported by the resource.
odataEtagodataEtagStringMapped drive item property; populated only when returned and supported by the resource.
downloadUrldownloadUrlStringMapped drive item property; populated only when returned and supported by the resource.
sourceUrlsourceUrlStringMapped drive item property; populated only when returned and supported by the resource.
conflictBehaviorconflictBehaviorStringMapped drive item property; populated only when returned and supported by the resource.
contentcontentStringMapped drive item property; populated only when returned and supported by the resource.
parentReferenceparentReferenceMSGraphDriveItemReferenceMapped drive item property; populated only when returned and supported by the resource.
fileSystemInfofileSystemInfoMSGraphDriveFileSystemInfoMapped drive item property; populated only when returned and supported by the resource.
folderfolderMSGraphDriveFolderFacetMapped drive item property; populated only when returned and supported by the resource.
filefileMSGraphDriveFileFacetMapped drive item property; populated only when returned and supported by the resource.
imageimageMSGraphDriveImageFacetMapped drive item property; populated only when returned and supported by the resource.
photophotoMSGraphDrivePhotoFacetMapped drive item property; populated only when returned and supported by the resource.
audioaudioMSGraphDriveAudioFacetMapped drive item property; populated only when returned and supported by the resource.
videovideoMSGraphDriveVideoFacetMapped drive item property; populated only when returned and supported by the resource.
locationlocationMSGraphDriveGeoCoordinatesMapped drive item property; populated only when returned and supported by the resource.
deleteddeletedMSGraphDriveDeletedFacetMapped drive item property; populated only when returned and supported by the resource.
pendingOperationspendingOperationsMSGraphDrivePendingOperationsMapped drive item property; populated only when returned and supported by the resource.
packageInfopackageInfoMSGraphDrivePackageFacetMapped drive item property; populated only when returned and supported by the resource.
publicationpublicationMSGraphDrivePublicationFacetMapped drive item property; populated only when returned and supported by the resource.
remoteItemremoteItemMSGraphDriveRemoteItemMapped drive item property; populated only when returned and supported by the resource.
rootrootMSGraphDriveRootFacetMapped drive item property; populated only when returned and supported by the resource.
searchResultsearchResultMSGraphDriveSearchResultMapped drive item property; populated only when returned and supported by the resource.
sharedsharedMSGraphDriveSharedFacetMapped drive item property; populated only when returned and supported by the resource.
sharepointIdssharepointIdsMSGraphDriveSharePointIdsMapped drive item property; populated only when returned and supported by the resource.
specialFolderspecialFolderMSGraphDriveSpecialFolderMapped drive item property; populated only when returned and supported by the resource.
malwaremalwareMSGraphDriveMalwareFacetMapped drive item property; populated only when returned and supported by the resource.
bundlebundleMSGraphDriveBundleFacetMapped drive item property; populated only when returned and supported by the resource.
childrenchildrenList<MSGraphDriveItem>Mapped drive item property; populated only when returned and supported by the resource.
permissionspermissionsList<MSGraphDrivePermission>Mapped drive item property; populated only when returned and supported by the resource.
versionsversionsList<MSGraphDriveItemVersion>Mapped drive item property; populated only when returned and supported by the resource.
thumbnailsthumbnailsList<MSGraphDriveThumbnailSet>Mapped drive item property; populated only when returned and supported by the resource.
listItemlistItemMSGraphDriveListItemMapped drive item property; populated only when returned and supported by the resource.
analyticsanalyticsMSGraphDriveItemAnalyticsMapped drive item property; populated only when returned and supported by the resource.

Behavior and limits

This implementation maps the returned collection without following or exposing @odata.nextLink. A result can contain only the first page; do not treat it as a complete tenant or resource inventory.

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.

This wrapper delegates the Graph operation to a shared file helper. It does not pass an explicit connector record ID to that helper, which initializes the default MSENTRA connector. A controller request.connectorId does not select the connection used by the delegated file call.

Blank Item Id selects the drive root; otherwise it lists children of the specified item. The returned items are metadata, not file content.

Use in Flow

Use MS Entra – Groups – Get Folder Items 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.GetEntraGroupLibraryItemChildren.GetEntraGroupLibraryItemChildrenInput request =
    new Apptigent.GetEntraGroupLibraryItemChildren.GetEntraGroupLibraryItemChildrenInput();
request.groupId = 'f11f1340-30b1-4f1d-91ec-c853b7245646';
request.driveId = 'b!X5oVvJY9mkCm2tS6Dpo0Q6';
request.itemId = '01ABCDEF23456789!123';
request.selectQuery = 'id,name,file,folder';
request.topQuery = '10';
request.orderbyQuery = 'name';



List<List<Apptigent.MSGraphDriveItem>> results =
    Apptigent.GetEntraGroupLibraryItemChildren.getLibraryItemChildren(
        new List<Apptigent.GetEntraGroupLibraryItemChildren.GetEntraGroupLibraryItemChildrenInput>{ request }
    );
System.debug(results);

Use in a Lightning Web Component

Use getEntraGroupLibraryItemChildren from msEntraConnectorLib through MSEntraConnectorController. These c/ imports apply in the same namespace. Set request.connectorId for direct MSEntraAction calls. This action delegates to a file helper using the default connection; the request selection does not reach that file call.

Global inputLWC request mapping
groupIdrequest.groupId
driveIdrequest.driveId
itemIdrequest.itemId
selectQueryrequest.selectQuery
topQueryrequest.topQuery
orderbyQueryrequest.orderbyQuery

entraActionExample.js

import { LightningElement } from 'lwc';
import { getEntraGroupLibraryItemChildren } 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.driveId = 'b!X5oVvJY9mkCm2tS6Dpo0Q6';
            request.itemId = '01ABCDEF23456789!123';
            request.selectQuery = 'id,name,file,folder';
            request.topQuery = '10';
            request.orderbyQuery = 'name';
            this.result = await getEntraGroupLibraryItemChildren(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 an array of mapped DTOs. 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

SymptomWhat to check
Required fields errorSupply a nonempty request list and required or conditionally required inputs. For LWC, use the mapped field names.
Authorization or access deniedCheck connector selection, sign-in, endpoint/target permission support, administrator consent, directory roles, and resource access.
Resource not foundCheck Microsoft IDs and parent resource relationships. Preserve group/drive/item associations and mailbox/calendar/event IDs.
Missing or unexpected outputCheck query support, pagination, wrapper versus item models, public-only properties, and mapped DTO fields.
Operation rejectedInspect the Microsoft error, supported writable fields, group/calendar restrictions, recipient/license data, and file transfer limits.

See Entra connector introduction.

Share this Doc

MS Entra – Groups – Get Folder Items

Or copy link

CONTENTS

Free eBook: The Ultimate Guide to Power Platform Custom Connectors

Antimanual

Ask our AI support assistant your questions about our platform, features, and services.

You are offline
Chatbot avatar
What can I help you with?

Subscribe

×
Cancel