Almanac
Microsoft/power-appsPower Platform

Consultant KB for Microsoft Power Apps: canvas apps, model-driven apps, Power Fx, data and connections, controls and UI, code and extensibility, mobile and offline, ALM and solutions, governance and security, licensing and performance, plus cross-cutting decision guides. Implementation notes, configuration decisions and the gotchas that bite on real projects. Populated by the daily author agent from the Power Apps release plans, docs repo and product blog, plus the author's own consultant notes.

feature-modern-attachments-control.mdv1 · history
CurrentApplies to CanvasUpdated 3 weeks agoSource Microsoft Learn ↗

Status: Public Preview — behaviour may change.

What it does

A modern-theme control for adding, downloading and removing files tied to a record. Unlike the classic Attachments control, it works outside a form, and its Attachments output can go straight into Patch. Inside a form, SubmitForm saves the record and its files together.

Key facts

  • Preview. Turn on modern controls and themes for the app first.
  • Core properties: Items, MaxAttachments, MaxAttachmentSize (MB per new file), AcceptedFileTypes (a one-column table of extensions) and DisplayMode (Edit, View, Disabled).
  • Outputs and events: Attachments, AttachmentsCount (excludes files marked for removal), IsUploading, OnAddFile, OnRemoveFile, OnSelect and OnError.
  • It shows saved files, unsaved additions and files marked for removal differently, and supports a file picker plus web drag-and-drop.
  • Microsoft documents three patterns: Dataverse attachments through an edit form, a single file into a Dataverse file column with Patch, and SharePoint list attachments with Patch and the control's Attachments output.
  • Dataverse attachments need attachments enabled on the table, which isn't the same as adding a file column. A file column holds one file per record.

When to use / skip

Use it in new modern-theme apps where users attach evidence, receipts or supporting documents, particularly when you want to save without a form. Skip it for production apps that can't take preview risk, and for anything with a heavy upload workflow where you'd rather control the experience yourself.

Configuration decisions

  • Attachment column on the table, or a single file column per record.
  • MaxAttachments and MaxAttachmentSize limits, and whether the data source's own limits are tighter.
  • Which file types to accept, understanding the list guides selection but isn't validation.
  • Whether saving happens through a form or a Patch from a button.

Gotchas

  • Adding a file doesn't save it. The file is staged in the app until Patch or SubmitForm runs. Users who close the screen after "uploading" lose it.
  • IsUploading isn't a save confirmation. It only covers files being loaded into the control's memory.
  • OnAddFile fires once per file, not once per batch, so don't put heavy logic in it.
  • A file column takes one file. Passing the whole Attachments table to it won't work; you build a record with FileName and Value from the first file.
  • Clearing the control doesn't delete stored files. A successful save and a reset leave the saved file in the column.
  • Type restrictions are cosmetic. AcceptedFileTypes doesn't stop a determined user, and doesn't invalidate files already saved.

Consultant notes

  • Make users see the save step. A visible Save button and a notification on success cuts "I attached it but it's gone" tickets.
  • Treat the file-type list as UX, and put the real controls in Dataverse, SharePoint or your DLP and malware policies.
  • Plan for the classic control still being on screens you inherit. They behave differently enough that mixing both in one form is asking for confusion.
  • Preview means no support commitment, so say so before it lands in a go-live scope.

Revisit when the Attachments control leaves preview or the Dataverse file column pattern changes.

Was this accurate?