MS Outlook – Folders – Get Child Folder From Folder Items

Estimated reading: 4 minutes

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

PropertyValue
Action labelMS Outlook – Folders – Get Child Folder From Folder Items
CategoryCloudTools
Apex class and methodGetMSOutlookChildFolderById.getChildFolderById
Input typeGetMSOutlookChildFolderById.GetMSOutlookChildFolderByIdInput
Output typeList<MSOutlookFolder>
AuthorizationNone for this local lookup.
Flow automationSupported; 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.

InputApex fieldTypeRequiredDescription
IdidStringYesFolder id to find.
ItemsitemsList<MSOutlookFolder>YesFolders 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.

OutputApex fieldTypeDescription
IdidStringFolder identifier.
Display NamedisplayNameStringFolder display name.
Parent Folder IdparentFolderIdStringParent folder identifier.
Child Folder CountchildFolderCountIntegerCount of child folders.
Unread Item CountunreadItemCountIntegerCount of unread messages.
Total Item CounttotalItemCountIntegerTotal count of messages.
Is HiddenisHiddenBooleanWhether folder is hidden.
OData TypeodataTypeStringOData type.
OData ETagodataEtagStringOData etag.
Additional PropertiesadditionalPropertiesList<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

SymptomWhat to check
No matchVerify Id and that Items contains the desired resource. This action does not fetch another page or query Microsoft.
Null resultCheck for null requests, blank Id, null Items, or a missing match before reading output fields.
Incomplete fieldsRetrieve the required properties in the earlier Graph lookup; the helper does not enrich the item.
Share this Doc

MS Outlook – Folders – Get Child Folder From 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