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 / How to get excel data ...
Power Automate
Answered

How to get excel data from outlook email attachment on desktop power automatic

(0) ShareShare
ReportReport
Posted on by 30
  • kinuasa Profile Picture
    803 Most Valuable Professional on at

    Hi,
    Power Automate for desktop retrieves messages with the 'Launch Outlook' action and the 'Retrieve email messages from Outlook' action.
    As the 'Retrieve email messages from Outlook' action allows you to save attachments, I suggest that you save the files together in a specified folder and then process only the Excel files with the 'Get files in folder' action.

     

    Regards,
    kinuasa


    The code below is a sample flow, which you can copy and paste into flow designer.

    SET AttachmentsFolderPath TO $'''C:\\Test\\Saved\\'''
    Outlook.Launch Instance=> OutlookInstance
    Outlook.RetrieveEmailMessages.RetrieveEmailsAndSaveAttachments Instance: OutlookInstance Account: $'''MyAccount''' MailFolder: $'''Inbox''' EmailsToRetrieve: Outlook.RetrieveMessagesMode.Unread MarkAsRead: False SaveAttachmentsInto: AttachmentsFolderPath Messages=> RetrievedEmails
    Folder.GetFiles Folder: AttachmentsFolderPath FileFilter: $'''*xls*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
  • zz123ff Profile Picture
    30 on at

    Hi kinuasa,

    Thank you for the answer.

     

    But in 'Retrieve email messages from Outlook' ,save attachment at bottom,

    it seems can't change the attachment name, is it only for the path?

     

    How can I change the saved file's name if I don't know it's original name in the email.

  • Verified answer
    kinuasa Profile Picture
    803 Most Valuable Professional on at

    How can I change the saved file's name if I don't know it's original name in the email.


    Each file can be renamed using the "For each" and "Rename file" actions.

     

    Sample_RenameAttachments.jpg

     

    The code below is a sample flow:

    Outlook.Launch Instance=> OutlookInstance
    Outlook.RetrieveEmailMessages.RetrieveEmailsAndSaveAttachments Instance: OutlookInstance Account: $'''MyAccount''' MailFolder: $'''Inbox''' EmailsToRetrieve: Outlook.RetrieveMessagesMode.Unread MarkAsRead: False SaveAttachmentsInto: $'''C:\\Test\\Saved''' Messages=> RetrievedEmails
    LOOP FOREACH RetrievedEmail IN RetrievedEmails
     IF RetrievedEmail.Attachments.Count > 0 THEN
     LOOP FOREACH Attachment IN RetrievedEmail.Attachments
     IF Contains(Attachment.Extension.ToLower, $'''xls''', False) THEN
     File.RenameFiles.Rename Files: Attachment NewName: $'''MYFILE_%Attachment.NameWithoutExtension%''' KeepExtension: True IfFileExists: File.IfExists.DoNothing RenamedFiles=> RenamedFiles
     END
     END
     END
    END
  • zz123ff Profile Picture
    30 on at

    Hi kinuasa

     

    According to your instructions, the file name changed successfully.

    助けていただきありがとうございます‼

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 335 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard