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

Announcements

No record found.

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 16
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
    whitebeard Profile Picture
    97 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

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 50 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans