Finding 365 email from Communications Mining Stream results

hello, I am using Communications Mining to classify emails from a mailbox and want to upload a copy of the emails to a software platform.
For this, I used the stream from Get Stream Results and I wanted to use Get email by Id in 365 scope to later download the email

I have tried using various Ids given in the CM stream to find the correct email and in all instances it errored saying the Id is malformed. (Id, Uid, SourceID, messageID…)

Could you please help me find the correct expression I should be writing in Get Email by ID? Thnank you :slight_smile:

hi, @idoia.fernandez

Use currentStreamResult.Comment.UserProperties("string:Message ID").ToString() in Get Email by ID.

Enable Use shared mailbox with your mailbox address

Ensure connection has Mail.Read scope

Loop through stream results and log currentStreamResult.Comment.UserProperties.Keys to confirm “string:Message ID” exists

Hi @idoia.fernandez

The issue is that Communications Mining does NOT return the real Microsoft 365 Message ID.
The IDs in the CM stream (Id, Uid, SourceId, etc.) are CM database IDs, not mailbox message IDs — so Get Email by ID will always fail as malformed.

Use Get Outlook Mail Messages (or Graph Get Emails) and filter by:

  • Subject
  • Sender
  • Received Time
  • or InternetMessageId (the xxxx@domain ID inside the message body)

Get Email by ID works only with a real Outlook/Graph Message ID, which CM does not provide.

@idoia.fernandez

ideally you would need the message ID and as per structure looks like under comments, user properties you have the message ID try to find the same

cheers