Power Apps modern Attachments control file uploads
Power Apps

Power Apps modern Attachments control file uploads

by HubSite 365 about Reza Dorrani

Principal Program Manager at Microsoft Power CAT Team | Power Platform Content Creator

Canvas app makers can stage files with the modern Attachments control and save them to supported data sources or use a custom upload flow.

Key insights

  • The modern Attachments control can be used outside a form, unlike the classic control.
  • Files are staged in the app and are not saved until the app submits or patches them.
  • Use SubmitForm for a form-based app or Patch for a standalone upload experience.
  • The control supports file count, size and extension settings such as AcceptedFileTypes.
  • For SharePoint document libraries, the demonstration describes Power Automate and a Microsoft Graph API approach.

Power Apps’ modern Attachments control lets canvas apps stage files and support custom upload experiences, including workflows that save files to a data source. It matters to makers building apps for document intake, record attachments or file selection outside a standard form. Reza Dorrani demonstrates several SharePoint approaches, including list attachments and document library uploads.

What it does

The modern Attachments control gives makers a way to let users add, review, download or remove files in a canvas app. Its key difference from the classic control is that it can be placed outside a form, so the upload interface does not have to follow the standard Edit form layout. A maker can build around a gallery, create a dedicated upload screen or use a custom arrangement.

Adding a file to the control does not by itself save it to a connected data source. Instead, the control stages the selection in the app. The app then saves changes through a form submission or a formula such as Patch, making it possible to separate file selection from the action that persists the change.

The control can also be part of an existing form workflow. When it is configured in a form, makers can use the form’s normal submission behavior to save the record and its attachments together. This gives teams a choice between a familiar form and a more tailored interface.

Who it is for and what you need

This control is for canvas app makers who need users to work with files tied to records or selected for another process. Examples include collecting documents for a request, adding receipts to an expense record, or choosing files for email or later processing. Users interact with the app; makers configure how the selected files are validated and saved.

Microsoft’s control documentation identifies the modern Attachments control as a preview capability. Makers should account for that status when evaluating it for a production app, and check the current documentation and behavior in their own environment before relying on it.

The starting point is a canvas app and the modern Attachments control. The save formula depends on the target data source and whether the app is handling record attachments or a file column. SharePoint list attachments and Dataverse attachments are distinct from uploading a file into a SharePoint document library; the latter may require a separate upload mechanism.

How it works

A basic standalone design has a place to select files, a control that displays the staged selection, and a Save action. The app can apply restrictions before it writes anything. For example, AcceptedFileTypes can limit allowed extensions, while MaxAttachments and MaxAttachmentSize set file-count and individual-size boundaries.

  1. Add the modern Attachments control to the canvas screen. Put it in a form for a form-based workflow, or place it independently for a custom experience.
  2. Configure the files shown by the control and set applicable limits, such as accepted extensions, maximum attachment count and maximum file size.
  3. Let users select and review files. The control’s Attachments output represents files being handled, including files added, retained or marked for removal.
  4. Save the change. Use SubmitForm when the control is part of a configured form. For a standalone design, use Patch with a formula appropriate to the data source and record or file-column type.

For a new standalone upload, the documented approach can set Items to Blank() so the control stages a new file rather than displaying an existing saved file. For a Dataverse file column, the documented pattern maps the selected file’s Name to FileName and its Value to the file content. The exact formula differs by data source and scenario, so makers should follow the relevant control documentation rather than assume one formula fits every target.

SharePoint document libraries need particular care. Reza Dorrani’s demonstration description outlines a Power Automate route using a file input on the flow trigger, as well as a Microsoft Graph API route using the Office 365 Groups connector. The control supplies the selected files, but the library upload path is a separate part of the app design; it should not be confused with saving attachments to a SharePoint list item.

Limitations and alternatives

The preview designation is the main planning consideration. Preview features can change, and makers should test their intended scenarios before depending on them in an app used for business-critical work. In particular, validate the combination of data source, file type, size and save action that the app actually needs.

File selection and file persistence are separate steps. A user can have a staged selection that has not been committed, so provide a clear Save action and decide how the app handles cancellation or reset. Check that configured size and count limits suit the connected data source, and that the accepted extensions match the files the process expects.

If the requirement is a SharePoint list item’s attachments, use the relevant record attachment workflow. If the goal is a document library, choose an upload path designed for that destination, such as the Power Automate or Graph API options described above. For a form-centered app, SubmitForm remains an alternative to a standalone Patch-based design.

Sources

Frequently asked questions

Can the modern Attachments control work outside a form?

Yes. It can be used as a standalone control on a canvas screen, unlike the classic control’s form-only upload and delete workflow.

Does selecting a file save it immediately?

No. The file is staged in the app. Save it with SubmitForm in a form workflow or an appropriate Patch formula in a standalone design.

Is the modern Attachments control generally available?

Microsoft’s documentation identifies it as a preview capability. Check the current documentation and test the scenarios you need before using it in production.

How can a Power Apps canvas app upload to a SharePoint document library?

The described approaches use Power Automate with a file input on the trigger, or Microsoft Graph API with the Office 365 Groups connector. This is separate from saving SharePoint list attachments.