cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
72Zib
Helper I
Helper I

Corrupted .XLSX or CSV File When Being Saved From Outlook

Hi,

 

I am getting corrupted file error when saving to OneDrive or SharePoint from outlook, I did try  

base64ToBinary(items('Apply_to_each')?['contentBytes'])

but the template will not let me save, please help

72Zib_0-1633134211440.png

Thanks Z

1 ACCEPTED SOLUTION

Accepted Solutions
ekarim2020
Super User
Super User

Let's start at the beginning when a new email arrives containing one or more file attachments. We will ensure that the attachments are properly save to OneDrive and SharePoint:

2021-10-02_20-42-12.jpg

We will use a loop to save each file attachment to OneDrive and SharePoint.  We use two loops, one for Value (Apply to each) because it is an array and stores the Outlook message, and another loop (Apply to each 2) to iterate through all the attachments in the email:

2021-10-02_20-45-03.jpg

The above content can be entered as dynamic content, from the When a new email arrived (V3) action:

2021-10-02_20-56-13.jpg

 

ekarim2020_0-1633207364726.png

Try the above and let me know how you get one.


Ellis


____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
ekarim2020
Super User
Super User

Try the following expressions to get the file content and save to SharePoint:

2021-10-02_18-22-59.jpg


Ellis

 


____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

Hi I am getting error message with this string, any idea why?

72Zib_0-1633197101184.png

72Zib_1-1633197114048.png

 

ekarim2020
Super User
Super User

Let's start at the beginning when a new email arrives containing one or more file attachments. We will ensure that the attachments are properly save to OneDrive and SharePoint:

2021-10-02_20-42-12.jpg

We will use a loop to save each file attachment to OneDrive and SharePoint.  We use two loops, one for Value (Apply to each) because it is an array and stores the Outlook message, and another loop (Apply to each 2) to iterate through all the attachments in the email:

2021-10-02_20-45-03.jpg

The above content can be entered as dynamic content, from the When a new email arrived (V3) action:

2021-10-02_20-56-13.jpg

 

ekarim2020_0-1633207364726.png

Try the above and let me know how you get one.


Ellis


____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

Thanks for this excellent explanation. This works great.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,302)