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 :
Power Apps - Microsoft Dataverse
Answered

Image in an email written to Dataverse rich text field is lost

(0) ShareShare
ReportReport
Posted on by 370

I have a Power Automate flow that takes emails from a shared mailbox and writes them to a custom Dataverse table.

 

This table has a multiline Text field, which is displayed on the form in the model driven app with the rich text editor control enabled.

 

The flow writes the body of the email to this field.

 

Which works fine. But if the email body has an inline image then a file path is inserted. Example of what's written to the field:

 

 

<img width="1281" height="648" id="Picture_x0020_1" src="cid:image003.jpg@01D6EB62.E776C010" style="width:13.3402in; height:6.75in">

 

 

In the rich text field this displays as the image not found icon.

 
If I paste an email into the rich text field in the app, it is all fine. It creates the images in the Rich Text Attachment entity and they display fine.
 
To make this work from a flow, do I need to do complicated stuff like get the image contentbytes from the email body and create a Rich Text Attachment record so I can link that back from the email body?
 
Is there a better way of handling this scenario of seeing inline images in a model driven app? 
Categories:
I have the same question (0)
  • mtoma Profile Picture
    on at
    Re: Image in an email written to Dataverse rich text field is lost

    Hello @mjburley ,

     

    Thank you for your post on the forum.

     

    In terms of root cause, the image available in the flow or wherever you have it hosted might not be available in Dataverse.

     

    Because the two of them do not share the same database, you can face this issue if your image has not been hosted somewhere accessible for both of them.

     

    If you want to try to confirm this search on the internet for an image, as the flow does not specify the image website or Azure blob associated with it, you need to find one online and replace it in your flow update, once that had been completed run your flow in order to confirm if the image is available, if that's the case you need to take into consideration the fact that you need to provide image source as an URL or something similar which should be accessible for both.

     

    Same thing happens while trying to add an image from local drive as the organization is unable to retrieve the image from the local drive.

     

    I hope this helps.

     

    Thank you,

    Madalina Toma

    Microsoft Support

  • Verified answer
    mjburley Profile Picture
    370 on at
    Re: Image in an email written to Dataverse rich text field is lost

    Thanks @mtoma.

     

    After some reading around, I found inline images are actually attachments, but I need to check on the Attachments isInline flag available from the email trigger.

    This allowed me to simply add the inline image as an attachment to the record (in Notes).

    I now need to find the best way of taking this attachment (which I can get as contentbytes) and inserting into the rich text field in the entity in the appropriate place. I can store it as a variable and then insert it within the img src tags in theory,

  • damian_green23 Profile Picture
    274 on at
    Re: Image in an email written to Dataverse rich text field is lost

    Did you get this working?  Can you share your solution?

  • mjburley Profile Picture
    370 on at
    Re: Image in an email written to Dataverse rich text field is lost

    I did get it working. It was horrible. Looking at the flow now, I'm not sure why I did some of what I did ...

     

    In essence, I get the attachments on that email (this is DataVerse emails from a DataVerse queue):

    mjburley_0-1715787832439.png

    Then I loop through each of these attachments to basically build an array of the img tags alongside the content bytes of each occurrence.

     

    mjburley_1-1715788043792.png

    Then I take the body of the email and replace all the img tag strings with their respective content bytes. (Being careful of the size of the images as the column definition of max bytes may soon be overtaken).

     

    mjburley_2-1715788272916.png

    Is this helpful ? It is making my head hurt looking at it again. If it's what you want, I can extract the relevant part of the flow.

  • damian_green23 Profile Picture
    274 on at
    Re: Image in an email written to Dataverse rich text field is lost

    I'm trying to go sort of the other way.  Any chance you have some experience with this one?

    Insert Rich Text Attachment into Rich Text Field i... - Power Platform Community (microsoft.com)

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

Coming soon: forum hierarchy changes

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

Chiara Carbone – Community Spotlight

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

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 803 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 314 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 253 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics