MS OneDrive – Get Item From Item Items

Estimated reading: 4 minutes

MS OneDrive – Get Item From Item Items

Finds the first matching item by ID in an existing collection. This local action makes no Microsoft Graph call and does not refresh or enrich the item.

Action details

PropertyValue
Action labelMS OneDrive – Get Item From Item Items
CategoryCloudTools
Apex class and methodGetOneDriveItemById.getItemById
Input typeGetOneDriveItemById.GetOneDriveItemByIdInput
Output typeList<MSGraphDriveItem>
AuthorizationNone for this local lookup.
Flow automationSupported without a connector.

Prerequisites and permissions

Supply the Microsoft Graph ID and a collection of MSGraphDriveItem retrieved by an earlier operation. This action needs no Connector record, Microsoft sign-in, or permission of its own. The operation that retrieves the collection has separate requirements.

Inputs

The table lists action labels, Apex field names, and Apex data types. Supply Id and Items for each local lookup.

InputApex fieldTypeRequiredDescription
IdidStringYesItem id to find.
ItemsitemsList<MSGraphDriveItem>YesItems to search.

Outputs

Returns one result per input request in order. Null requests, blank Id, null Items, or an unmatched ID produce null entries. A null or empty input list returns a list containing one null. Null Items entries are skipped; a match returns the first existing object with that ID.

OutputApex fieldTypeDescription
ididStringMicrosoft Graph resource identifier.
namenameStringResource name.
descriptiondescriptionStringItem description.
createdDateTimecreatedDateTimeStringCreation timestamp retained as text.
lastModifiedDateTimelastModifiedDateTimeStringLast modification timestamp retained as text.
createdBycreatedByMSGraphDriveIdentitySetIdentity that created the resource.
lastModifiedBylastModifiedByMSGraphDriveIdentitySetIdentity that last modified the resource.
webUrlwebUrlStringBrowser link to the resource.
webDavUrlwebDavUrlStringWebDAV URL.
sizesizeLongSize in bytes.
eTageTagStringItem entity tag.
cTagcTagStringContent entity tag.
odataTypeodataTypeStringMapped OData type.
odataEtagodataEtagStringMapped OData entity tag.
downloadUrldownloadUrlStringMapped @microsoft.graph.downloadUrl, when returned.
sourceUrlsourceUrlStringMetadata returned when populated.
conflictBehaviorconflictBehaviorStringMetadata returned when populated.
contentcontentStringContent field, if mapped; do not rely on it as a download.
parentReferenceparentReferenceMSGraphDriveItemReferenceParent identifiers and path through driveId, id, and path.
fileSystemInfofileSystemInfoMSGraphDriveFileSystemInfoFile system timestamps.
folderfolderMSGraphDriveFolderFacetFolder facet, including childCount.
filefileMSGraphDriveFileFacetFile facet, including mimeType; this facet is not the file bytes.
imageimageMSGraphDriveImageFacetMetadata returned when populated.
photophotoMSGraphDrivePhotoFacetMetadata returned when populated.
audioaudioMSGraphDriveAudioFacetMetadata returned when populated.
videovideoMSGraphDriveVideoFacetMetadata returned when populated.
locationlocationMSGraphDriveGeoCoordinatesMetadata returned when populated.
deleteddeletedMSGraphDriveDeletedFacetMetadata returned when populated.
pendingOperationspendingOperationsMSGraphDrivePendingOperationsMetadata returned when populated.
packageInfopackageInfoMSGraphDrivePackageFacetMetadata returned when populated.
publicationpublicationMSGraphDrivePublicationFacetPublication state and checkout identity.
remoteItemremoteItemMSGraphDriveRemoteItemMetadata returned when populated.
rootrootMSGraphDriveRootFacetMetadata returned when populated.
searchResultsearchResultMSGraphDriveSearchResultMetadata returned when populated.
sharedsharedMSGraphDriveSharedFacetMetadata returned when populated.
sharepointIdssharepointIdsMSGraphDriveSharePointIdsMetadata returned when populated.
specialFolderspecialFolderMSGraphDriveSpecialFolderMetadata returned when populated.
malwaremalwareMSGraphDriveMalwareFacetMetadata returned when populated.
bundlebundleMSGraphDriveBundleFacetMetadata returned when populated.
childrenchildrenList<MSGraphDriveItem>Child items only when included in the response.
permissionspermissionsList<MSGraphDrivePermission>Permissions only when included in the response.
versionsversionsList<MSGraphDriveItemVersion>Versions only when included in the response.
thumbnailsthumbnailsList<MSGraphDriveThumbnailSet>Metadata returned when populated.
listItemlistItemMSGraphDriveListItemMetadata returned when populated.
analyticsanalyticsMSGraphDriveItemAnalyticsMetadata returned when populated.

Optional facets depend on the item type and response. Parent Reference exposes driveId, id, and path; Folder exposes childCount; File exposes mimeType rather than bytes. Metadata timestamps remain text. This action does not automatically expand children, permissions, or versions. A downloadUrl, when supplied, is a temporary download URL; webUrl is the browser link.

Use in Flow

Add MS OneDrive – Get Item From Item Items in Flow Builder. Supply Id and Items from a previous collection output, then handle a null match before reading fields. This helper processes every supplied lookup request.

Use in custom Apex

This subscriber-org example uses the Apptigent namespace. Populate existingItems with the previously retrieved collection; an empty list produces no match.

List<Apptigent.MSGraphDriveItem> existingItems = new List<Apptigent.MSGraphDriveItem>();
// Populate existingItems before the lookup.

Apptigent.GetOneDriveItemById.GetOneDriveItemByIdInput request =
    new Apptigent.GetOneDriveItemById.GetOneDriveItemByIdInput();
request.id = 'REPLACE_WITH_GRAPH_ID';
request.items = existingItems;

List<Apptigent.MSGraphDriveItem> results =
    Apptigent.GetOneDriveItemById.getItemById(
        new List<Apptigent.GetOneDriveItemById.GetOneDriveItemByIdInput>{ request }
    );

Apptigent.MSGraphDriveItem item = results.isEmpty() ? null : results[0];
String resultId = item == null ? null : item.id;
System.debug(resultId);

The example leaves exception handling, authorization setup, and presentation or persistence of the result to the calling application.

Use in a Lightning Web Component

There is no exported LWC function or controller endpoint for this local helper. A custom Apex controller can invoke it, or an already-loaded JavaScript collection can be searched locally:

const item = (items || []).find(
    candidate => candidate && candidate.id === targetId
) || null;

This JavaScript example uses exact string equality and makes no callout. Keep the original resource ID unchanged. A missing item is not fetched from another page.

Error handling and troubleshooting

SymptomWhat to check
No matchVerify Id and that Items includes the resource. This action does not retrieve additional pages.
Null resultCheck the request and collection, and handle null before reading fields.
Incomplete propertiesRetrieve the needed properties in the earlier Graph action; the helper does not enrich the item.
Share this Doc

MS OneDrive – Get Item From Item 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