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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Embed image in email f...
Power Apps
Answered

Embed image in email from powerapps- help

(0) ShareShare
ReportReport
Posted on by 71

Hi,

Looking for more help/advice.

 

So, I have an "App" that is connected to a sharepoint list. User can update the list and attach images.

 

For the user to upload the image im using "Add Picture" and then in that function its getting updated to SharePoint list and changed to base64 using below formula.

 

Patch(
 'Generator Inspection',
 LookUp('Generator Inspection', ID = Gallery4.Selected.ID),
 {
 'Generator Changeover Switch':Substitute(
 JSON(
 UploadedImage1.Image,
 JSONFormat.IncludeBinaryData
 ),
 """",
 ""
 )
 }
 );

 

I have proved it works it works as below you can see the data in the list and I have also pullled that data into the app with the "Image" function and it displays the image as it should.

JohnB2_0-1661180407376.png

Where I'm getting stuck now is, embedding that image into an email once a button is pressed. Below is the code I am using to send the email. The email sends okay, but what ever I try, the image will not appear in the email. 

 

Set(varChangeSwitch,(Gallery4.Selected.'Generator Changeover Switch'));

Office365Outlook.SendEmailV2(
 "email address", //yes, I have removed my email address for this form :)
 "Test", //Subjsect
 "<img src=" & varChangeSwitch & ">");

 

 

Categories:
I have the same question (0)
  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    If I remember correctly, to get the image to show you need to strip out the "data&colon;image/jpeg;base64," header to get to the actual base64 data. Some images end up with "png" instead of "jpeg" in the header

  • JohnB2 Profile Picture
    71 on at

    Hi,

    Thanks for replying but no joy with your suggestion

    I manually put the base64 string into the email instead of a variable to try also - no good.

    I put the base64 string into an online base64 - image converter to prove to myself the data string is okay - and it was.

    I even created a new app just to test the email with the string to see if my app got somehow corrupted. Same result.

     

    By any chance am I doing something silly with the email formula?

  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    After looking I think you do want the whole string. The email call looks correct. You may need quotes around the base64 string. I would watch this video - Shane lays out everything.  

  • Verified answer
    JohnB2 Profile Picture
    71 on at

    Hi,

    Thanks for that, he clearly explains everything.

    But it didn't solve my issue. But I figured it out!!. 

     

    When I was setting the base64 string from the data card as a string(in the below code), I was pointing it to the whole data card and not the text value in that data card🙈.

     

    Once I corrected that, it worked no problem. Silly me. I really should stop and have a look at what I'm doing from time to time 😂😂.

     

     

     

    Set(varChangeSwitch,(Gallery4.Selected.'Generator Changeover Switch'));
    
    Office365Outlook.SendEmailV2(
     "email address", //yes, I have removed my email address for this form :)
     "Test", //Subjsect
     "<img src=" & varChangeSwitch & ">");

     

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard