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
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.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,868)