kwoxer
kwoxer

Reputation: 3833

Microsoft Office 365 Scope activity - Office365message getting Subject of a Mail

I use the Microsoft Office 365 Scope activity. But I need the Subject and the body of that mail. Btw I cannot use the other activity "Get Outlook Mail Message" because I need the query parameter of the GetMail activity.

enter image description here

So as you can see from the picture I want to return the mail subject and so on. But I have no idea how to access it. The only thing I always get is "UiPath.MicrosoftOffice365.Models.Office365Message".

So my question is, is it possible via the Get Mail activity to return the subject and body? If yes what is the statement to get it?

I already had a look here:

Upvotes: 1

Views: 2238

Answers (3)

Henrik Carlsen
Henrik Carlsen

Reputation: 65

I may have gotten the question wrong, as I can easily read mails with the Office365 scope. The list is handled in a "For Each", with the item-type set to UiPath.MicrosoftOffice365.Models.Office365.Message. I can then access the subject with item.Subject.

Upvotes: 0

Daniel Mitchell
Daniel Mitchell

Reputation: 51

MailArray(0).Body and MailArray(0).Subject are how you would get the body and subject of the first Office365Message in the array.

The Get Mail activity returns an array, which you're using correctly to look at the first one at index 0. But you need to explicitly tell the Log Message (or any other activity) which method/property you're using. Typing MailArray(0). will bring up a list of all available properties and methods given the current object type.

Upvotes: 2

kwoxer
kwoxer

Reputation: 3833

I don't think it's possible in UiPath. So this is a solution for Power Automate (Flow):

  1. so first we need a trigger for new mails
  2. now we need a condition the checks for a contains on the Subject object
  3. finally you now have a trigger that is working only when the subject is of substring "..." what you have definied

Overall the Flow should look like this: enter image description here

Upvotes: 0

Related Questions