Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Uploading files to CDS Entity "File" Datatype (filetype)

Hi PowerAppers,

I need to attach 3 files (PDFs) to each record in a CDS entity. I have enabled attachments on the entity. I am also making use of the "File" datatype (filetype) in the CDS entity. I have 3 "File" fields in the entity.


Through a form and I am able to upload and attach files to the 3 fields manually with no problems. The trouble is I have thousands of records in the entity and I need an automated way to upload and attach all these files to their corresponding records.


I have been experimenting with Power Automation, with no luck. The "Update a Record" action does not expose the "File" datatype fields. I read somewhere that the file attachments are stored in the "Note" entity, but the "File" datatype attachments are not.


Can you please help me figure out a practical way to automate this process?


Many Thanks



Accepted Solutions

The File data type stores the files in blob storage. They are retrieved from the storage via the API using non-resolvable URLs. 

View solution in original post

Super User
Super User

Hi @bilalsh01,

The File type of field is still in preview so the Power Automate functionality for that field might not be all be ready. The only method I know is with Web API or the .NET SDK:

You probably need to write some script in .NET or PowerShell to migrate the files...

Hope this helps...

Thank you very much @EricRegnier  for your response. 


Yes, I came across this article during my research. I am hoping I can accomplish my mission without having to go the .NET or PowerSell routs because I am not really savvy there.


However, I have just figured out how to upload the PDFs to the Attachment of my entity using the Note entity by using an Automation flow. I'm thinking about making a video about this. It took me forever to figure it out. I'm sure others would find it useful.


Worst case scenario, I can upload the 3 PDFs to the same record in my entity through the Note entity. 


It would be really nice though, to know where the "File" datatype attachments are stored. That would make life a lot easier. I would appreciate it anyone knows.


Many Thanks,


Yes but attachments in notes activity are not the File field type. How will you move them to the file fields? Or are you planning on having notes attachments for history and file type fields for current and ongoing attachments?

You can use power automate to do this job. Using CDS connector you can upload the files to the entity in the file or image attribute.



just putting the following json in the content


"$content-type": "application/pdf",
"$content": "<base 64 string file>"


I hope that helps you. Please mark as a solution if help you.

The File data type stores the files in blob storage. They are retrieved from the storage via the API using non-resolvable URLs. 

Thank you all for your help and responses.


In light of this,


@EricRegnier I think I have no easy choice right now except to keep the files as Note Attachments instead of using the "File" datatype. 


@Michaelfp Thank you for your help, I looked into the "Upload file or Image content" action, but I don't have it, I read somewhere that it is only available for USAGovernment.


@NHelgren Thanks for the info, now you have put my mind to rest and unfortunately I will have to use the Note Attachments for now until Microsoft provides an easier way to automate uploading to "File" datatype.


Thanks again everyone.


Make sure to submit your thoughts on bulk uploading Files to Ideas.

It´s not true.


I used in many non-USA Government instances. Take a look with you have the correct licenses or your instance is up to date.



I'm trying to upload email attachments using Flow.  The Flow completes successfully, but when I download the attachment(s) I get an error that reads "Couldn't download - Server problem".  I suspect it is because I did not convert the file to binary.  In your json recommendation, you reference "<base 64 string file>".  Within the context of Outlook attachments, how would I construct the base 64 string file--especially if there are multiple attachments?  


Thanks in advance for any assistance you can lend.

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (3,713)