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

Notifications

Announcements

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
I have the same question (0)
  • kinuasa Profile Picture
    795 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
    795 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard