MS OneDrive – Get Item From Item Items
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
| Property | Value |
|---|---|
| Action label | MS OneDrive – Get Item From Item Items |
| Category | CloudTools |
| Apex class and method | GetOneDriveItemById.getItemById |
| Input type | GetOneDriveItemById.GetOneDriveItemByIdInput |
| Output type | List<MSGraphDriveItem> |
| Authorization | None for this local lookup. |
| Flow automation | Supported 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.
| Input | Apex field | Type | Required | Description |
|---|---|---|---|---|
| Id | id | String | Yes | Item id to find. |
| Items | items | List<MSGraphDriveItem> | Yes | Items 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.
| Output | Apex field | Type | Description |
|---|---|---|---|
| id | id | String | Microsoft Graph resource identifier. |
| name | name | String | Resource name. |
| description | description | String | Item description. |
| createdDateTime | createdDateTime | String | Creation timestamp retained as text. |
| lastModifiedDateTime | lastModifiedDateTime | String | Last modification timestamp retained as text. |
| createdBy | createdBy | MSGraphDriveIdentitySet | Identity that created the resource. |
| lastModifiedBy | lastModifiedBy | MSGraphDriveIdentitySet | Identity that last modified the resource. |
| webUrl | webUrl | String | Browser link to the resource. |
| webDavUrl | webDavUrl | String | WebDAV URL. |
| size | size | Long | Size in bytes. |
| eTag | eTag | String | Item entity tag. |
| cTag | cTag | String | Content entity tag. |
| odataType | odataType | String | Mapped OData type. |
| odataEtag | odataEtag | String | Mapped OData entity tag. |
| downloadUrl | downloadUrl | String | Mapped @microsoft.graph.downloadUrl, when returned. |
| sourceUrl | sourceUrl | String | Metadata returned when populated. |
| conflictBehavior | conflictBehavior | String | Metadata returned when populated. |
| content | content | String | Content field, if mapped; do not rely on it as a download. |
| parentReference | parentReference | MSGraphDriveItemReference | Parent identifiers and path through driveId, id, and path. |
| fileSystemInfo | fileSystemInfo | MSGraphDriveFileSystemInfo | File system timestamps. |
| folder | folder | MSGraphDriveFolderFacet | Folder facet, including childCount. |
| file | file | MSGraphDriveFileFacet | File facet, including mimeType; this facet is not the file bytes. |
| image | image | MSGraphDriveImageFacet | Metadata returned when populated. |
| photo | photo | MSGraphDrivePhotoFacet | Metadata returned when populated. |
| audio | audio | MSGraphDriveAudioFacet | Metadata returned when populated. |
| video | video | MSGraphDriveVideoFacet | Metadata returned when populated. |
| location | location | MSGraphDriveGeoCoordinates | Metadata returned when populated. |
| deleted | deleted | MSGraphDriveDeletedFacet | Metadata returned when populated. |
| pendingOperations | pendingOperations | MSGraphDrivePendingOperations | Metadata returned when populated. |
| packageInfo | packageInfo | MSGraphDrivePackageFacet | Metadata returned when populated. |
| publication | publication | MSGraphDrivePublicationFacet | Publication state and checkout identity. |
| remoteItem | remoteItem | MSGraphDriveRemoteItem | Metadata returned when populated. |
| root | root | MSGraphDriveRootFacet | Metadata returned when populated. |
| searchResult | searchResult | MSGraphDriveSearchResult | Metadata returned when populated. |
| shared | shared | MSGraphDriveSharedFacet | Metadata returned when populated. |
| sharepointIds | sharepointIds | MSGraphDriveSharePointIds | Metadata returned when populated. |
| specialFolder | specialFolder | MSGraphDriveSpecialFolder | Metadata returned when populated. |
| malware | malware | MSGraphDriveMalwareFacet | Metadata returned when populated. |
| bundle | bundle | MSGraphDriveBundleFacet | Metadata returned when populated. |
| children | children | List<MSGraphDriveItem> | Child items only when included in the response. |
| permissions | permissions | List<MSGraphDrivePermission> | Permissions only when included in the response. |
| versions | versions | List<MSGraphDriveItemVersion> | Versions only when included in the response. |
| thumbnails | thumbnails | List<MSGraphDriveThumbnailSet> | Metadata returned when populated. |
| listItem | listItem | MSGraphDriveListItem | Metadata returned when populated. |
| analytics | analytics | MSGraphDriveItemAnalytics | Metadata 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
| Symptom | What to check |
|---|---|
| No match | Verify Id and that Items includes the resource. This action does not retrieve additional pages. |
| Null result | Check the request and collection, and handle null before reading fields. |
| Incomplete properties | Retrieve the needed properties in the earlier Graph action; the helper does not enrich the item. |