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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Attachment Preview Content Copy – Possible?

(3) ShareShare
ReportReport
Posted on by 6
Hi Experts,

Is there a way to copy or extract the content shown in the attachment preview on the Email entity form in Dynamics 365? I would like to know if the preview pane content can be accessed or copied programmatically or using any out‑of‑the‑box functionality.
 
 
 
 
 
Regards,
Devarajan S.
Image (2).png
Image (1).png
Categories:
I have the same question (0)
  • Suggested answer
    iampranjal Profile Picture
    85 on at

    Hi @DS-09011323-0,

    There is no supported out-of-the-box functionality or Client API to directly copy or extract text from the Attachment Preview control UI. The preview pane renders content (often within an iframe) that is not accessible via the standard formContext or supported JavaScript methods.

    Microsoft explicitly lists DOM manipulation (which would be required to "scrape" the preview pane) as an unsupported customization that may break with updates.

    Supported Solution:
    Instead of trying to read the preview pane, you should retrieve the file content programmatically using the Dataverse Web API.

    1. Query the Attachment: Use Xrm.WebApi.retrieveMultipleRecords to query the activitymimeattachment table. You will need to filter by the objectid (the Email ID) to find the relevant attachment.
    2. Get the Content: Request the body column, which contains the file content as a Base64 encoded string.
    3. Decode: In your JavaScript or Plugin logic, decode the Base64 string to access the raw file.
      • Note: If the attachment is a PDF or Word doc, the decoded string will be binary. You would need a library (like pdf.js for client-side or OpenXML for server-side) to extract actual text from that binary data.

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

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

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
iampranjal Profile Picture

iampranjal 64

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 60 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 40 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans