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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Problem with base64 en...
Power Automate
Unanswered

Problem with base64 encoding of image using Get file content

(0) ShareShare
ReportReport
Posted on by 16

Hi Experts,

 

I have designed a flow for sending out Birthday emails to Employees. But I'm stuck on a very silly problem. I have used an image from the Sharepoint folder using Get file content. I have also used base64 encodings to convert it in my email body as you can see:

 

screencapture-us-flow-microsoft-manage-environments-Default-e0793d39-0939-496d-b129-198edd916feb-flows-35c98abd-27a5-4cd2-9aeb-f4793dfcb943-2021-09-26-17_24_09.png

 

But unfortunately, it just doesn't fetch the image at all and I don't see the email in the correct format as you can see below.

 

Ranjeet_7396_1-1632658413775.png

 

The difference I notice is here from what I learned on Youtube videos and what I actually see. What is the cause for this? I don't see the purple logos for output but instead, see these Abc things?

 

Ranjeet_7396_0-1632658295255.png

 

Any help is highly appreciated, please. Thanks

 

Ranjeet

 

Categories:
I have the same question (0)
  • eric-cheng Profile Picture
    5,171 on at

    Hi @Ranjeet_7396 ,

     

    Theres a few blogs here and here available where you can check if our expression is the same.

     

    Image isnt clear on my mobile but have you closed off the image tag with /> ?

     
    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn
  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    Try switching to HTML code view (click </>) then enter the IMG tag:

    ekarim2020_1-1632663189507.png

    Ellis

     

  • Ranjeet_7396 Profile Picture
    16 on at

    Hi,

     

    Please help guide the image tag:

    Ranjeet_7396_0-1632983592857.png

     

    Am I doing anything wrong, why those outputs are not coming properly for selection?

     

    Regards,

    Ranjeet

  • Ranjeet_7396 Profile Picture
    16 on at

    Hi Eric,

     

    Thanks, yeah I did close the image tag now and the result is the same. I think I am going wrong in the Output selection, as you can see the list does not have the usual violet-colored output icons but instead those options look different as you can see in my screenshots.

     

    Any reasons for those looking different pls?

     

    Ranjeet

  • eric-cheng Profile Picture
    5,171 on at

    Hi @Ranjeet_7396 ,

     

    I have just done a test and it is working.  I suggest copying your email body out and starting with just the image and then gradually adding the text back in.

     

    Compose Action 

    @base64(outputs('Get_file_content')?['body'])

     

    Email Body (paste this in to the code view of body)

    <img src="data&colon;image/jpg;base64, @{outputs('Compose')}" />

     

    ericcheng_0-1632989049592.png

     

    ericcheng_1-1632989073499.png

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn

     

     

  • Ranjeet_7396 Profile Picture
    16 on at

    Hi @eric-cheng!

     

    Thanks, we are close!! I tried the above and the result is better than before:

     

    Before:

    Ranjeet_7396_1-1632991436134.png

     

    Now:

    Ranjeet_7396_0-1632991289241.png

     

    I only changed Compose to Compose 2 in your expression since that's where I am fetching the image from. Is that correct?

    But it looks odd and the Flow doesn't run with Compose 2 in place:

     

    With Compose in Place:

    Ranjeet_7396_3-1632991590357.png

     

    With Compose 2 in Place:

     

    Ranjeet_7396_2-1632991518978.png

     

    Anything else wrong, or why is the image not loading? Its from the Sharepoint and there is no issues with the image.

     

    Thanks for your great help again.

     

    Ranjeet

  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at
     

    Please check the syntax of the img tag with that @eric-cheng provided. Once entered is should look like the text boxed in green:

     

    2021-09-30_11-35-31.jpg

    Ellis

  • Ranjeet_7396 Profile Picture
    16 on at

    Hi @ekarim2020 ! 🙂

     

    Thanks for pointing out the correction. I did change and try now, but still the results aren't much different. I think there is something wrong with Compose 2 operation from where I am fetching the image?

     

    I see it as below now when I try to save it:

    Ranjeet_7396_0-1633003811113.png

     

    Here is what the Compose 2 operation has within:

     

    Ranjeet_7396_1-1633004289064.png

    Thanks,

    Ranjeet

  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    I'm expecting Outputs in the img tag link to look like this:

    2021-09-30_13-35-32.jpg

    If the img tag is correct, then suspect that the image is already in base64 format?? As a test, remove the base64() function from the compose action, leaving only:

    ekarim2020_1-1633005773420.png

    Ellis

  • Ranjeet_7396 Profile Picture
    16 on at

    Hi @ekarim2020 Good Morning

     

    I did so.

    Ranjeet_7396_0-1633076863930.png

     

    Any change in the Email body as well then? Inside the image tag, please? Sorry, I am not from a coding background, just trying my hands on and thus the basic questions.

     

    Ranjeet_7396_1-1633079774219.png

     

     

    Thanks in advance.

    Ranjeet

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard