cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
isaac1
Helper II
Helper II

Flow saves xlsx attachment from shared mailbox - cannot be opened by Excel

I have a flow:

 

When a new email arrives in a shared mailbox (V2)

  1. Apply to Each > Get Attachment (V2)
  2. Initialize Variable > varFileName (string) > concat(utcNow('yyyyMMddhhmmss'),'_','COBOReport.xlsx')
  3. Apply to Each > Create File > (I provide Site Address, Doc Library  name, and varFilename for File Name configuration)
    1. File Content = Dynamic Content (Attachments Content)

Everything works great.  File gets saved as 20210429095033_COBOReport.xlsx

 

However, the file cannot be opened by Excel - something is wrong with it.  

 

Yet, I can open the email and the .xlsx file is perfectly fine - there is nothing wrong with the attachment.

 

How can I fix this?

1 ACCEPTED SOLUTION

Accepted Solutions
jinivthakkar
Super User
Super User

@isaac1 you are getting error because by default there is no content available for attachment, here is the flow which works. I have used a different trigger but remaining actions would be same for both us.

 

jinivthakkar_0-1619763632109.png

I tried this with 2 attachments and it worked fine for both.

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
jinivthakkar
Super User
Super User

@isaac1 you are getting error because by default there is no content available for attachment, here is the flow which works. I have used a different trigger but remaining actions would be same for both us.

 

jinivthakkar_0-1619763632109.png

I tried this with 2 attachments and it worked fine for both.

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

isaac1
Helper II
Helper II

Thanks!  Interestingly, last night (after I posted here), I came across that solution too - and tried to implement it, but when I did, the Flow ran (no error) and then the resulting file exhibited the same problem.  However, this morning, I can clearly see that I made a mistake....I had the Create File outside of the apply to each - somehow I'd messed up the sequence of steps.

 

Anyway - you are right - this now works, thanks!

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

Users online (2,817)