MS Outlook – Folders – Get Child Folder From Folder Items
MS Outlook – Folders – Get Child Folder From Folder Items
Get an Outlook child folder from a collection of folders by id. Searches the supplied collection locally without contacting Microsoft.
Returns the first non-null item whose id matches the supplied Id. It does not refresh data, fetch missing items, or verify the mailbox. A match returns the existing item with its current fields.
Action details
| Property | Value |
|---|---|
| Action label | MS Outlook – Folders – Get Child Folder From Folder Items |
| Category | CloudTools |
| Apex class and method | GetMSOutlookChildFolderById.getChildFolderById |
| Input type | GetMSOutlookChildFolderById.GetMSOutlookChildFolderByIdInput |
| Output type | List<MSOutlookFolder> |
| Authorization | None for this local lookup. |
| Flow automation | Supported; no connector or external authorization required. |
Prerequisites and permissions
Supply a previously retrieved collection of MSOutlookFolder items and the Microsoft Graph ID to find. No Microsoft permissions, Connector record, callout context, or signed-in Microsoft user are needed for this action itself. The action that originally retrieves the collection has its own requirements.
Inputs
The table lists action labels, Apex field names, and data types. Provide one lookup request per item you want to find.
| Input | Apex field | Type | Required | Description |
|---|---|---|---|---|
| Id | id | String | Yes | Folder id to find. |
| Items | items | List<MSOutlookFolder> | Yes | Folders to search. |
Outputs
Returns one result for each supplied request, in the same order. A null request, blank Id, null Items, or missing match produces a null result. Null or empty input lists return a list containing one null. Null collection entries are skipped. The action returns only fields already present in Items.
| Output | Apex field | Type | Description |
|---|---|---|---|
| Id | id | String | Folder identifier. |
| Display Name | displayName | String | Folder display name. |
| Parent Folder Id | parentFolderId | String | Parent folder identifier. |
| Child Folder Count | childFolderCount | Integer | Count of child folders. |
| Unread Item Count | unreadItemCount | Integer | Count of unread messages. |
| Total Item Count | totalItemCount | Integer | Total count of messages. |
| Is Hidden | isHidden | Boolean | Whether folder is hidden. |
| OData Type | odataType | String | OData type. |
| OData ETag | odataEtag | String | OData etag. |
| Additional Properties | additionalProperties | List<DynamicObject> | Additional data returned by query. |
Available properties depend on how Items was originally retrieved. Do not treat an absent field as proof of its value. Timestamps represented by String remain text. Counts and metadata do not contain the full contents of the resource.
Use in Flow
Add MS Outlook – Folders – Get Child Folder From Folder Items in Flow Builder. Supply Id and Items from an earlier collection output. Handle a null match before reading its fields. The method processes every lookup request.
Use in custom Apex
This subscriber-org example uses the Apptigent namespace. Replace placeholders before use. Populate existingItems with the actual previously retrieved collection; an empty list returns no match.
// Populate this list with items returned by an earlier lookup.
List<Apptigent.MSOutlookFolder> existingItems =
new List<Apptigent.MSOutlookFolder>();
Apptigent.GetMSOutlookChildFolderById.GetMSOutlookChildFolderByIdInput request =
new Apptigent.GetMSOutlookChildFolderById.GetMSOutlookChildFolderByIdInput();
request.id = 'REPLACE_WITH_GRAPH_ID';
request.items = existingItems;
List<Apptigent.MSOutlookFolder> results =
Apptigent.GetMSOutlookChildFolderById.getChildFolderById(
new List<Apptigent.GetMSOutlookChildFolderById.GetMSOutlookChildFolderByIdInput>{ request }
);
Apptigent.MSOutlookFolder item = results.isEmpty() ? null : results[0];
String resultId = item == null ? null : item.id;
System.debug(resultId);
The example leaves exception handling and result presentation to the calling application.
Use in a Lightning Web Component
There is no exported LWC library function or controller endpoint for this local invocable helper. A custom Apex controller can call it when needed. For an already-loaded JavaScript collection, you can perform a local lookup:
const item = (items || []).find(
candidate => candidate && candidate.id === targetId
) || null;
if (item) {
// Use the existing item fields.
}
This JavaScript example uses exact string equality. Pass the original ID unchanged; it makes no network call and cannot find an item outside the loaded collection.
Error handling and troubleshooting
| Symptom | What to check |
|---|---|
| No match | Verify Id and that Items contains the desired resource. This action does not fetch another page or query Microsoft. |
| Null result | Check for null requests, blank Id, null Items, or a missing match before reading output fields. |
| Incomplete fields | Retrieve the required properties in the earlier Graph lookup; the helper does not enrich the item. |