Skip to main content
Community site session details

Community site session details

Session Id : 45sD9De3YSaeBxYQiXpaMp
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

  • flowuser6 Profile Picture
    31 on 19 Apr 2023 at 12:38:12
    Re: Insert Banner Image URL into email body - Works fine with jpg files but not PNG images

    Hello! What I ended up doing wasn't pretty and I'm not sure ideal for long-term solution, but it is working for us at the moment! We ended up grabbing that image and converting it into a JPG within the flow by downloading it to a OneDrive business folder with format of ".jpg". Since the issues we were having were large PNG files.

     

    There are some options for steps that could help you. Convert File (if it is a OneDrive file) and Compress Image/Convert Image Format but for these last 2 I didn't know how to use it since it's asking for an API key.

  • AMMK Profile Picture
    2 on 18 Apr 2023 at 04:05:10
    Re: Insert Banner Image URL into email body - Works fine with jpg files but not PNG images

    Dear Flowuser6,

     

    Greetings!

     

    We have the similar requirement to automate the news/post. We are facing the same issue (if we add image with size more than 500kb approx. in the banner image url [it didnt worked when i tried with 800kb] the images are getting removed in the email that we receive). Did you get chance to find any work around for this as you mentioned above? It would be very helpful if you could share some idea.

     

    If anyone has came across this scenario and implemented any work around, please feel free to suggest!

     

    Thanks

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

    Hi Ellis! I figured out the issue. I feel so foolish! So, last night I had a thought, maybe it is the file size of the png file that is causing the issue. PNG files are always larger than JPG files. So, this morning I resaved the png file so the file size wasn't as large. Previously it was 1.24 MB and this morning I tested with a png file size of 528 KB. This was the issue!!! The png file sizes that the flow was trying to include were too large. Do you happen to know a definite file size limit? If not, I'll keep testing to see the cut off point for png file sizes embedded in an email. Maybe try to see if there is a way to compress the image within the flow..

     

    Oh my goodness!! Thank you so much for bearing with me and testing this all out. You've been the only actual support I've had with this issue, so I greatly appreciate it!!!

     

    Here are the screenshots I took of the flow output and email received this morning after reducing the png file size.

    flow-outputs-with-smaller-png-file-size.jpg

     

    flow-with-smaller-png-file-size.jpg

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

    Yes, access to the SiteAssets/SitePages seems to be fine. It is still worth testing, by sending an PNG file that is stored in a Document Library - to see if you get the same problem.

     

    To demonstrate, I created a new flow to read a PNG file from the /SiteAssets/SitePages on my SharePoint site:

    Snag_6abd60.png

     

    This is the email that was sent, and the PNG image is visible in Outlook:

    ekarim2020_0-1646779287575.png

    Ellis

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

    I don't think I have issues accessing content from the SiteAssets/SitePages folder. The flow works perfectly fine with a jpg file. I've attached screenshots. Would this suffice to rule out any issues accessing content from the SiteAssets/SitePages folder? If not, I can run a flow as requested tomorrow!

     

    Email Received:

    Email Received when JPG file is used instead of PNGEmail Received when JPG file is used instead of PNG

     

    Email BodyEmail Body

     

    Get File Content Using Path when the Banner Image URL is referencing a jpg not png:

    Get File Content Using Path Output DownloadGet File Content Using Path Output Download

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

    Asa test can you test your flow using an image located in a Document Library and not from the /SiteAssets/SitePages folder. Any image will do, you just need the Site Address and File Path. We are trying to rule out any issues with accessing content from the /SiteAssets/SitePages folder.

     

    For example:

    Snag_ef32ec.png

     

    Snag_f0084d.png

    Then create a new flow or modify your existing flow:

    ekarim2020_0-1646771634620.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

  • Ellis Karim Profile Picture
    11,175 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 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,175 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

     

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!