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
Resident Rockstar
Resident Rockstar

@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
Resident Rockstar
Resident Rockstar

@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

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,193)