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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (3,123)