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

Moving Files out of Dataverse using Automation tools

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello Dynamics 365 Fans!

Sometimes you might have a requirement to move data outside of Dynamics, either because of a Business Decision  or because of a previous storage model restriction. In either way, we can use Automation tools to connect to Dataverse and move the  files (attachments) to another location.

We'll be showing some examples to move attachments to Azure Blob Storage.  However, a similar procedure can be used to move data to SharePoint, OneDrive, or to send emails with the attachments.  Also, please note this will NOT reduce the file size of your Dataverse environment, since there are other considerations/fields used for this calculation.  Also, its important to note that this is a Proof of Concept and that before placing this into production, you should test this and confirm the behavior & File availability.

The first part is to trigger the action. I'm also declaring a couple variables to store the FileName and FileContent.  Then, using the Dataverse component to query Dataverse and retrieve the rows of a specific table, on this case, Notes (or Annotation, that stores the notes added within Dataverse)

pastedimage1672674558389v2.png

We can see that at the bottom we have an "apply to each", which will basically allow to move and process each record retrieved from the previous query, in a separated way:

pastedimage1672674769485v3.png

From this previous image, we can see that the first step is to retrieve the details of each record.  If you check the output of this step, you'll get a JSON and this is waht we're going to process on the rest of the steps.  From here, we'll work with the Filename and DocumentBody:

pastedimage1672674931467v4.png

Take note that the DocumentBody contains the Base64 string associated with the file.   That's the reason behind the following steps:

pastedimage1672675117587v5.png

From here, we set the FileName variable as a string containing the GUID of the record, a dash and the original filename.  This will then be transformed (using lowercase function), as Azure Blob Storage has a requirement for files to be Lowercase.  Following this, we get the string associated with the Document Body and we use a transformation step to convert the Base64 string to binary.  Finally, we have a step to store  to the files into a specific location:  A container of our choice with a specific route, and then we set the BlobName as our filename (that will be lowercase) and the BlobContent to our FileContent, as shown in the following picture:

pastedimage1672675306688v6.png

Once our automation executes, we should start to see our folder being populated:

pastedimage1672675465411v7.png

Again, we must reiterate that this is a proof of concept.  Definitive automation should include more steps to validate content, the type of files, for example, as well as extensive test.

Regards

I have the same question (0)
  • Leco Lv Profile Picture
    Microsoft Employee on at

    Hi partner,

    Good point! thanks for sharing.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
11manish Profile Picture

11manish 174

#2
ManoVerse Profile Picture

ManoVerse 58 Super User 2026 Season 1

#3
Niki Patel Profile Picture

Niki Patel 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans