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 Export Outlook ...
Power Automate
Unanswered

How to Export Outlook mails to CSV?

(1) ShareShare
ReportReport
Posted on by
I want to export mails to CSV, and this should be from a particular time period, and I'd want the Sender name, subject, date, Body to be added in diff columns. I am surprised that there is no simple way to achieve this. 
 
So if someone has exported mails using Outlook, please help me. 
Categories:
I have the same question (0)
  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at
    You would just do this:
    1. Make a call to the graph API to retrieve the e-mails: https://graph.microsoft.com/v1.0/me/messages, which you'll most likely want to filter. This post shows an example: How To Get Over 25 Emails In Power Automate
    2. In your flow create a string variable. Make the default value the headings for the csv file. For example, Sender, Subject, Date, Body. Use this expression at the end to add a carriage return decodeUriComponent('%0A')
    3. Add an apply to each to process each of the e-mails.
    4. In the apply to each, use the append to string variable action to create the csv file and populate the values in the order you set the header as the default value for the string variable making sure to add a comma after each, and adding the carriage return at the end.
    5. You can then save the output of the variable to a csv file.
     
    The biggest challenge you will probably have is with the body. You will need to figure out how to deal with any potential commas in the body. You will also most likely want to use the convert html to text action on the body as well. I currently don't foresee me having any need to do something like this, so I am not even going to try and figure out how to deal with the body.
     
    You may want to test what I outline above without adding the body. If it does what you want, then add the body and see what challenges you have and make a new post specific to that.

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 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard