cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kuglarz96
Level: Powered On

Can't open pdf in email attachment

Hello,

 

I cannot open pdf attachment in email sent by flow despite that the SAME formula is working in next steps of the SAME flow.

 

Here is how it works:

1) I'm creating pdf from template, and send HTTP request with it inside.

555.png

 

2) I receive HTTP request in next flow:

5551.png

Code inside is 

{
    "type": "object",
    "properties": {
        "PDFFileContent": {
            "type": "object",
            "properties": {
                "$content-type": {
                    "type": "string"
                },
                "$content": {
                    "type": "string"
                }
            }
        },
        "ListItemID": {
            "type": "string"
        }
    }
}

 

3) I send email with pdf in attachment:

5552.png

 

4) And I cannot open it in received email:

5554.png

 

5) Whats more, I have the same formula in next steps of this flow, and it is working good ( I can open pdf without problem )

5553.png

 

I have no idea why it is not working. I tried to export and import this flow, delete and add step with sending email with attachment, but none of them worked. Whats more despite that this is the same formula in "attachment content" field, the received attachments in email are also diffrent by their weight ( first one, corrupted, is ~100 KB bigger ).

 

Thank you for all your help

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Can't open pdf in email attachment

Hi @kuglarz96 

 

In the attachment content part

 

just pass triggerBody()?['PDFFileContent']

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

3 REPLIES 3
Super User
Super User

Re: Can't open pdf in email attachment

Hi @kuglarz96 

 

In the attachment content part

 

just pass triggerBody()?['PDFFileContent']

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Super User
Super User

Re: Can't open pdf in email attachment

Hey @kuglarz96 

 

Try wrapping the $content in binary in the expression editor: 

binary(triggerBody()?['PDFFileContent']?['$content'])

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

kuglarz96
Level: Powered On

Re: Can't open pdf in email attachment

Thank you both , I didn't have time to respond at weekend.

 

@RezaDorrani  Your solution worked perfectly. I don't understand mechanic behind it in 100% as first code I typed was from ready to click dynamic content, but anyway thank you very much, I appreciate your help

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 285 members 5,291 guests
Please welcome our newest community members: