cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Trouble with saving PDF attachments to SharePoint

I am using the following flow for saving attachments to SharePoint:

 

I am trying to implement a simple flow for saving email attachment

  1. Trigger: When a new email arrives (with attachments)
  2. Apply to each, selected output from previous step: Attachments (triggerOutputs()?['body/attachments'])
  3. Create file
    • Site Address: selected from dropdown
    • Folder Path: Dynamic Full Path (outputs('Create_new_folder:_Folder_Name')?['body/{FullPath}']
    • File Name: Dynamic Attachments Name (items('Apply_to_each')?['name'])
    • File Content: Dynamic Attachments Content (items('Apply_to_each')?['contentBytes'])

Screenshot 2020-10-22 113209.png

 

The file appears to save but when I try to open it, I get the following error message: Adobe Acrobat could not open 'FileName.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded). 

 

When I save the file manually, it opens just fine. It only fails when PA saves the file.

 
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

@mobashee 

 

Thank you for your input. That setting was already in place. I started over using a template this time and the attachments now save without giving an error message about being decoded improperly. There must be a key difference between the template's version of creating a file in SharePoint vs. the generic create file when building from scratch. Using the peek code option, I see the following differences that might contribute:

 

Generic create file version:

Screenshot 2020-10-26 150851.png

 

Template create file version:

Screenshot 2020-10-26 151455.png

 

I'm not sure what makes the working difference between them, but the second one is working and I'll use it going forward.

View solution in original post

2 REPLIES 2
Highlighted
Microsoft
Microsoft

Dear Partner,

Set Include Attachment to “Yes”, in Action when a new email arrives

 
 

Regards,

Mohamed Sanuj Basheer

 

Highlighted

@mobashee 

 

Thank you for your input. That setting was already in place. I started over using a template this time and the attachments now save without giving an error message about being decoded improperly. There must be a key difference between the template's version of creating a file in SharePoint vs. the generic create file when building from scratch. Using the peek code option, I see the following differences that might contribute:

 

Generic create file version:

Screenshot 2020-10-26 150851.png

 

Template create file version:

Screenshot 2020-10-26 151455.png

 

I'm not sure what makes the working difference between them, but the second one is working and I'll use it going forward.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (8,598)