web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Retrieve email message...
Power Automate
Answered

Retrieve email messages from outlook [Power Automate Desktop]

(0) ShareShare
ReportReport
Posted on by 28

Hi Everyone,

 

I am trying to save the outlook attachments into OneDrive using Power Automate Desktop. I am getting an error in the initial setup itself as "Failed to retrieve email messages from Outlook".

 

ArunkumarK_0-1614273684404.png

 

I have the same question (0)
  • Expiscornovus Profile Picture
    33,846 Most Valuable Professional on at

    Hi @ArunkumarK,

     

    Can you check if the account value is exactly the same as the name of the Outlook account (data file name)?

     

    You can find the account name in the account settings of Outlook.
    accountsettingsexchange.png

     

    Can you also double check if the Mail folder value is using the full folder path format?

    https://docs.microsoft.com/en-gb/power-automate/desktop-flows/actions-reference/outlook#retrieveemailmessages

     

  • ArunkumarK Profile Picture
    28 on at

    Hi @Expiscornovus ,

     

    Thanks for your reply.

    Yes I mentioned the same account name. In my case account name and the email address are the same.

  • Expiscornovus Profile Picture
    33,846 Most Valuable Professional on at

    Hi @ArunkumarK,

     

    Can you share a screenshot of the configuration of your Retrieve email message from Outlook action from your desktop flow setup?

     

    Or alternatively copy the action and paste the configuration as code in here.

     

    Below is an example of my action which I used for testing.

    Outlook.RetrieveEmails Instance: OutlookInstance Account: OutlookDataFileName MailFolder: MailFolder EmailsToRetrieve: Outlook.RetrieveMessagesMode.Unread MarkAsRead: False SubjectContains: $'''PIM''' Messages=> RetrievedEmails

     

  • ArunkumarK Profile Picture
    28 on at

    Screenshot:

    ArunkumarK_1-1614345094484.png

     

    Copied the Action Items:

    Outlook.RetrieveEmails Instance: OutlookInstance Account: <REMOVEDBYME> MailFolder: $'''Inbox''' EmailsToRetrieve: Outlook.RetrieveMessagesMode.All MarkAsRead: True Messages=> RetrievedEmails

     

    Error Details:

    Exception has been thrown by the target of an invocation.: Robin.Core.ActionException: Failed to retrieve email messages from Outlook ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
    --- End of inner exception stack trace ---
    at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
    at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
    at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
    at Robin.Modules.Outlook.Actions.OutlookActions.GetProperty(Object o, String propertyName)
    at Robin.Modules.Outlook.Actions.OutlookActions.RetrieveEmailMessagesFromOutlook(Variant outlookInstance, Variant account, Variant mailFolder, Variant fromContains, Variant toContains, Variant subjectContains, Variant bodyContains, Variant sentSince, Variant sentUpTo, Variant saveAttachmentsInto, Variant& retrievedEmails, Int32 retrieveCategory, Int32 attachmentsOption, Boolean markAsRead)
    --- End of inner exception stack trace ---
    at Robin.Modules.Outlook.Actions.RetrieveEmailMessages.Execute(ActionContext context)
    at Robin.Runtime.Engine.ActionRunner.RunAction(String action, Dictionary`2 inputArguments, Dictionary`2 outputArguments, IActionStatement statement)

  • Expiscornovus Profile Picture
    33,846 Most Valuable Professional on at

    Hi @ArunkumarK,

     

    I can reproduce this issue when I try to retrieve all email messages from my Inbox.

     

    Can you try and use some other conditions? When you switch to only unread emails form the Inbox does it work in your desktop flow?

    Outlook.RetrieveEmails Instance: OutlookInstance Account: OutlookDataFileName MailFolder: $'''Inbox''' EmailsToRetrieve: Outlook.RetrieveMessagesMode.Unread MarkAsRead: False Messages=> RetrievedEmails

     

  • ArunkumarK Profile Picture
    28 on at

    Hi @Expiscornovus ,

    I tried both as well but same error.

    And just FYI, Mark as unread options is to flag the unread emails as read. our action will read all the email messages irrelevant to read or unread emails. Please correct me if i am wrong.

  • Expiscornovus Profile Picture
    33,846 Most Valuable Professional on at

    Hi @ArunkumarK,

     

    Sorry that I wasn't clear. I was talking about setting the Retrieve field to a different option.

     

    It feels like we are both hitting a limit/time-out issue or something like that.

     

     

    retrievefield.png

     

    To be clear, my inbox folder has 10000+ items. Only retrieving the unread email messages reduces that query a lot.

  • ArunkumarK Profile Picture
    28 on at

    Oh Apologies I was misunderstood.

     

    As suggested, tried the options but the same error. Is there anything security settings needs to changed in outlook?

     

    ArunkumarK_0-1614349636658.png

     

    ArunkumarK_1-1614349683179.png

     

  • Expiscornovus Profile Picture
    33,846 Most Valuable Professional on at

    Hi @ArunkumarK,

     

    I am not aware of any additional security settings required. You can already access the same account and Inbox in your Outlook, correct?

     

    Have you tested any of the other outlook actions? You might want to run a test with for instance the send email through Outlook via that same account. This way you can troubleshoot if it is an account related issue.

     

    testoutlookmessage.png

  • ArunkumarK Profile Picture
    28 on at

    No, there is no issues with the outlook account. Just for additional investigation I asked for. Actually, I can access and all are working fine with the outlook when I used Power Automate web, but its not working in Power Automate Desktop.

    FYI, I will receive csv files to my email daily and needs to load into sql, but in web version, csv options are not available hence moved to desktop version.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 997

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 642

Last 30 days Overall leaderboard