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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

How to programmatically download attachments in notes

(0) ShareShare
ReportReport
Posted on by 50

Does anyone know how to pragmatically download attachments from Opportunity notes? I have been able to download and upload to SharePoint any EMBEDDED attachments stored in msdyn_fileblob, but if it is a direct attachment stored in annotations documentbody, it is not in the same file format. I am not familiar with how to convert this into a text/plain fileblob format I can upload to sharepoint.

Working on a script to migrate all notes to SharePoint and update opportunities with hyperlink to document (space savings).

I have the same question (0)
  • Verified answer
    Levi Stevens Profile Picture
    50 on at

    Solutions was following:

    $fileblob = [System.Convert]::FromBase64String($documentbody)

    $upload = Call-WebAPI -URI "$mgurl/drives/$PDR_RootID/root:/$locationurl/$($fileName):/content" -Method PUT -Accept "text/plain" -Authorization $Token2 -Body $fileblob -ContentType 'text/plain'

    Using the content type 'text/plain'.

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 > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 213 Super User 2026 Season 1

#2
CU11031447-0 Profile Picture

CU11031447-0 100

#3
NeerajPawar Profile Picture

NeerajPawar 71

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans