web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : 5qXQ7Z4TsSn5eNdTQoMDKi
Power Automate - Building Flows
Answered

Insert Banner Image URL into email body - Works fine with jpg files but not PNG images

Like (0) ShareShare
ReportReport
Posted on 8 Mar 2022 15:23:07 by 31

I marked a solution below as to what is needed for the images to work for this flow. But ultimately my issue was because of the image file size (not the format).

---------------------------------------------

I'm working a flow and everything works as expected for a news post's Banner Image URL using a jpg image file. But when a PNG image file is being used instead, the image does not display in the email desktop application nor the web application for Outlook. The JPG file does show, though, in both Outlook's desktop and web. And Outlook is the primary email application being used for our purposes.

 

I'm using two "Get File Content Using Path" steps. The first one is a static image, and that works just fine. The second one needs to be dynamic per the news post, and that is the one that works with jpgs but not pngs. The input url for the file path in this second one works when I paste it into the browser search bar. I've attached a partial screenshot of what the output for this second "Get File Content Using Path" looks like. It is super long!

 

Here are the expressions for the datauri items in the email body:

1st instance: @{dataUri(outputs('Get_file_content_using_path')?['body'])}

2nd instance: @{dataUri(outputs('Get_file_content_using_path')?['body'])}

 

I've tried every solution I could find, but haven't been able to figure this out. Maybe it is something so simple that I am missing?! I'm fairly new at this, so learning as I go along. I've attached screenshots of the flow. Hoping there is an answer out there! Thank you!

 

power-automate-flow-part-1_LI.jpg

 

power-automate-flow-part-2_LI.jpg

 

power-automate-flow-part-3_LI.jpg

 

 

power-automate-flow-part-4-email_LI.jpg

 

get-file-content-using-path-2-output.jpg

I have the same question (0)
  • Verified answer
    Ellis Karim Profile Picture
    11,472 Super User 2025 Season 2 on 08 Mar 2022 at 15:46:41
    Re: Insert Banner Image URL into email body - Works fine with jpg files but not PNG images

    Please take a look at this post:

    https://powerusers.microsoft.com/t5/Building-Flows/Get-file-jpg-from-SharePoint-folder-and-insert-image-as-email/m-p/1486224/highlight/true#M166161

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • flowuser6 Profile Picture
    31 on 08 Mar 2022 at 16:21:45
    Re: Insert Banner Image URL into email body - Works fine with jpg files but not PNG images

    Thank you for posting that! I took a look at it and incorporated those steps into my flow, but it still did not work.

     

    In the body email I put: <img src="data:@{outputs('ComposeContentType')};base4,@{outputs('ComposeContent')}">

     

    But in the email it sent out, in the "View Source" I got: <img> It took out everything from the img tag.

     

    flow-update-1_LI.jpg

  • Ellis Karim Profile Picture
    11,472 Super User 2025 Season 2 on 08 Mar 2022 at 16:29:29
    Re: Insert Banner Image URL into email body - Works fine with jpg files but not PNG images

    What do you see during runtime? For example, here is my runtime output for the demo flow:

    Snag_105cc8.png

    Snag_108455.png

    Ellis

  • flowuser6 Profile Picture
    31 on 08 Mar 2022 at 16:37:39
    Re: Insert Banner Image URL into email body - Works fine with jpg files but not PNG images

    Your outputs look so perfect! But mine has that really long code from the start of the "Get File Content Using Path 2" step. The input/output for the "ComposeContent" step is using that long code, too. Any idea what I'm doing wrong?

     

    Here are the screenshots.

     

    flow-update-1-outputs.jpg


    Partial screenshot of "Get File Content Using Path 2" outputs when I click to download:

    flow-update-1-outputs-get-file-content-using-path-2.jpg

  • Ellis Karim Profile Picture
    11,472 Super User 2025 Season 2 on 08 Mar 2022 at 16:39:12
    Re: Insert Banner Image URL into email body - Works fine with jpg files but not PNG images

    I've just seen a typing error. It needs to be base64

    Snag_18d2cc.png

  • flowuser6 Profile Picture
    31 on 08 Mar 2022 at 16:47:10
    Re: Insert Banner Image URL into email body - Works fine with jpg files but not PNG images

    I was really hoping that was the issue! I updated the body email so it has base64, but the email still isn't showing the png file.

     

    flow-update-2.jpg

  • Ellis Karim Profile Picture
    11,472 Super User 2025 Season 2 on 08 Mar 2022 at 17:01:20
    Re: Insert Banner Image URL into email body - Works fine with jpg files but not PNG images

    Please show the runtime output again.

    If the content-type and content appear OK, then I suspect it's the HTML code used in the send email action.

     

    Can you construct a very simple Send Email action such as:

     

     

     

    <img src="data:@{outputs('ComposeContentType')};base4,@{outputs('ComposeContent')}">

     

    Snag_2db839.png

     

     

    Snag_304e64.png

    Ellis

     

  • flowuser6 Profile Picture
    31 on 08 Mar 2022 at 18:53:44
    Re: Insert Banner Image URL into email body - Works fine with jpg files but not PNG images

    Ellis, thank you very much for sticking with this and helping me out! I tried an email with just the image tag as suggested, but it still didn't work out for me.

     

    Email BodyEmail Body

     

    Email RunEmail Run

     

    Email Input Download:

    Email Input DownloadEmail Input Download

     

    Email Output Download:

    Email Output DownloadEmail Output Download

  • Ellis Karim Profile Picture
    11,472 Super User 2025 Season 2 on 08 Mar 2022 at 19:42:58
    Re: Insert Banner Image URL into email body - Works fine with jpg files but not PNG images

    (1) Please show the message that is sent, for example the demo flow I created sent the following email message and image:

    ekarim2020_0-1646767858730.png

    (2) and please show the outputs of the compose action:

    ekarim2020_1-1646767896367.png

     

    This is the demo flow that I have been using:

    ekarim2020_2-1646768199468.png

     

    Ellis

  • flowuser6 Profile Picture
    31 on 08 Mar 2022 at 20:09:55
    Re: Insert Banner Image URL into email body - Works fine with jpg files but not PNG images

    Attached is a screenshot of the email I receive, it is just blank. In the browser application, when I use the inspect tool from the browser, this is what it reads:

    <img data-imagetype="Empty" data-imageerror="SrcNullOrEmpty">

     

    Here are the screenshots of the flow. So, I'm using the compose steps at the beginning to get the clean url from the Banner Image URL dynamic item (maybe these initial steps is what is wrong with my flow?). I'm using these, though, to get the clean version of the Banner Image URL since when I first inserted that into the "Get file content using path" didn't work. And here are the screenshots of the outputs.

     

    email receivedemail received

    Compose steps to get file path of Banner Image Url:

    The compose steps to get the file urlThe compose steps to get the file url

     

    Compose Outputs after "Get file content using path 2":

    compose steps after Get File Content Using Pathcompose steps after Get File Content Using Path

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 655 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 371 Moderator

#3
chiaraalina Profile Picture

chiaraalina 276

Last 30 days Overall leaderboard
Loading started
Loading complete