MS Outlook – Folders – Get Folder Message From Message Items
MS Outlook – Folders – Get Folder Message From Message Items
Get an Outlook folder message from a collection of messages 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 Folder Message From Message Items |
| Category | CloudTools |
| Apex class and method | GetMSOutlookFolderMessageById.getFolderMessageById |
| Input type | GetMSOutlookFolderMessageById.GetMSOutlookFolderMessageByIdInput |
| Output type | List<MSOutlookMessage> |
| Authorization | None for this local lookup. |
| Flow automation | Supported; no connector or external authorization required. |
Prerequisites and permissions
Supply a previously retrieved collection of MSOutlookMessage 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 | Message id to find. |
| Items | items | List<MSOutlookMessage> | Yes | Messages 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 | Message identifier. |
| Subject | subject | String | Message subject. |
| Body Preview | bodyPreview | String | Message body preview. |
| Body | body | MSOutlookMessageItemBody | Message body. |
| From | fromRecipient | MSOutlookMessageRecipient | From recipient. |
| Sender | senderRecipient | MSOutlookMessageRecipient | Sender recipient. |
| To Recipients | toRecipients | List<MSOutlookMessageRecipient> | Recipient collection. |
| Cc Recipients | ccRecipients | List<MSOutlookMessageRecipient> | CC recipient collection. |
| Bcc Recipients | bccRecipients | List<MSOutlookMessageRecipient> | BCC recipient collection. |
| Reply To | replyTo | List<MSOutlookMessageRecipient> | Reply-to recipient collection. |
| From Address | fromAddress | String | From email address. |
| Sender Address | senderAddress | String | Sender email address. |
| To Recipients | toRecipientsCsv | String | Comma-separated recipients. |
| Cc Recipients | ccRecipientsCsv | String | Comma-separated CC recipients. |
| Bcc Recipients | bccRecipientsCsv | String | Comma-separated BCC recipients. |
| Received Date Time | receivedDateTime | String | Received timestamp. |
| Sent Date Time | sentDateTime | String | Sent timestamp. |
| Created Date Time | createdDateTime | String | Created timestamp. |
| Last Modified Date Time | lastModifiedDateTime | String | Last modified timestamp. |
| Parent Folder Id | parentFolderId | String | Parent folder identifier. |
| Internet Message Id | internetMessageId | String | Internet message identifier. |
| Web Link | webLink | String | Outlook web link. |
| Is Draft | isDraft | Boolean | Whether message is draft. |
| Has Attachments | hasAttachments | Boolean | Whether message has attachments. |
| Importance | importance | String | Message importance. |
| Conversation Id | conversationId | String | Conversation identifier. |
| Conversation Index | conversationIndex | String | Conversation index. |
| Follow Up Flag | followUpFlag | MSOutlookMessageFollowupFlag | Follow-up metadata. |
| Attachments | attachments | List<DynamicObject> | Message attachments. |
| Extensions | extensions | List<DynamicObject> | Message extensions. |
| 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. Nested body and recipient properties follow the Apex message model; content, recipient collections, and attachment expansion are not guaranteed.
In the Apex model, Body exposes content and contentType. Each recipient exposes emailAddress.address and emailAddress.name. Follow Up Flag exposes flagStatus, startDateTime, dueDateTime, and completedDateTime; each date object has dateTime and timeZone. Availability depends on response mapping. Use the top-level id for Graph message operations, rather than internetMessageId or conversationId.
Use in Flow
Add MS Outlook – Folders – Get Folder Message From Message 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.MSOutlookMessage> existingItems =
new List<Apptigent.MSOutlookMessage>();
Apptigent.GetMSOutlookFolderMessageById.GetMSOutlookFolderMessageByIdInput request =
new Apptigent.GetMSOutlookFolderMessageById.GetMSOutlookFolderMessageByIdInput();
request.id = 'REPLACE_WITH_GRAPH_ID';
request.items = existingItems;
List<Apptigent.MSOutlookMessage> results =
Apptigent.GetMSOutlookFolderMessageById.getFolderMessageById(
new List<Apptigent.GetMSOutlookFolderMessageById.GetMSOutlookFolderMessageByIdInput>{ request }
);
Apptigent.MSOutlookMessage 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. |