Power Apps File Upload Without a Form: The Attachments Control Myth

If you've ever tried to add file upload to a canvas app, you've read this sentence somewhere: "The Attachments control only works inside a form." It's in forum answers, blog posts, and even in how the insert menu behaves. I believed it too. My own component roadmap had a do-not-build note on it.

Then I actually tested it. The claim is wrong.

You can have a working file upload on an empty screen, in an app with zero forms and zero data sources, in about one minute. Real drag and drop included. This post shows the test, gives you the YAML to reproduce it, and covers the one thing the control genuinely can't do (spoiler: it holds files, it doesn't store them).

What you'll build:

  • A standalone Attachments control on a blank screen, no form anywhere
  • A live file counter reading the attached files
  • A way to actually save those files to SharePoint

Time needed: ~10 minutes

Power Apps Attachments control working standalone on an empty screen without a form

Where the myth comes from

Open Power Apps Studio and look at the Insert menu. Search for "attachments". Nothing. The control simply isn't offered there.

Power Apps insert menu with no Attachments control available

That's the entire myth. Because you can't insert it, everyone concluded you can't have it outside a form. Microsoft's own docs only describe it as part of a form card, which didn't help.

But inserting and pasting are two different operations. Studio's "Paste code" accepts YAML for controls the insert menu has never heard of. So the real question was never "is the control available", it was "does the pasted control actually work without a form's data card behind it".

The test

On August 27 I pasted an Attachments@2.3.0 block onto an empty screen. New app, no forms, no data sources connected. Here's what happened:

  • The control rendered and accepted files: PDFs, Word, Excel, images
  • Native drag and drop worked. Dragging a PDF from the desktop onto the control just... attached it
  • The files were readable through the control's .Attachments property, live
  • MaxAttachments limited the count exactly as configured

No errors, no form, no data source. The "can't work standalone" claim confused the insert menu's limitation with a limitation of the control itself.

Dragging a PDF file onto the standalone Power Apps Attachments control

Try it yourself: the YAML

Copy this, then in Power Apps Studio right-click in the Tree view and choose Paste code:

- attFileUpload:
    Control: Attachments@2.3.0
    Properties:
      BorderColor: =RGBA(0, 0, 0, 0)
      BorderThickness: =0
      Color: =RGBA(59, 130, 246, 1)
      DisplayMode: =DisplayMode.Edit
      Fill: =RGBA(0, 0, 0, 0)
      FocusedBorderThickness: =0
      Height: =220
      MaxAttachments: =5
      Width: =380
      X: =40
      Y: =40

That's a working uploader. Click "Attach file" or drag files straight onto it.

The version tag matters. Attachments@2.3.0 is the control type Studio exports today. If a future Studio version rejects the paste, insert an Attachments control through a temporary form, open View code on it, and copy whatever control type name Studio uses now.

Reading the files

The control exposes everything through .Attachments. Each item has a Name and a Value (the file content). A few formulas you'll actually use:

Count the attached files (put this in a label to watch it update live):

CountRows(attFileUpload.Attachments)

Get the first file's name:

First(attFileUpload.Attachments).Name

Disable a submit button until something is attached:

If(IsEmpty(attFileUpload.Attachments), DisplayMode.Disabled, DisplayMode.Edit)

There are also two events, OnAddFile and OnRemoveFile, that fire when the user adds or removes a file. Handy for validation messages or updating a counter variable.

The honest caveat: holding is not saving

Here's the part the control genuinely doesn't do, and where the myth had a grain of truth: the Attachments control holds files in the app session. It stores nothing anywhere. Close the app, files gone.

You have two real options to persist them.

Option 1: SharePoint list attachments via a form

If your files belong to a list item (an inspection record, a ticket, an expense), the classic route still applies: an Edit form bound to a SharePoint list, where the attachments card saves on SubmitForm(). This is the one scenario where you do want the form.

Option 2: Power Automate flow

For everything else, send the files to a flow. The trick is JSON() with binary data included:

YourFlow.Run(
    JSON(attFileUpload.Attachments, JSONFormat.IncludeBinaryData)
)

In the flow, parse the JSON and use "Create file" (SharePoint or OneDrive) for each entry. The Value field carries the file content as base64.

Test the flow with one small PDF first. IncludeBinaryData makes the payload big fast, and it's much easier to debug a 50KB run than a 25MB one.

Skip all this: paste the finished component

A bare Attachments control works, but it looks like a bare Attachments control. The Document Upload component wraps it in a proper dropzone card: icon, caption, helper text, brand-tinted file chips that work in light and dark mode, and the max-file setting exposed in a settings panel. There's a compact variant for forms, a tinted one, a minimal one, and a Photo Upload built the same way.

PowerLibs Document Upload component, a styled dropzone built on the Attachments control

Pick one, set your color, copy the YAML, paste. Same one-minute paste as above, but it looks like someone designed it.


Related components

  • Document Upload - Styled dropzone on the real Attachments control, three extra variants
  • Photo Upload - Image picker built the same way
  • Signature Pad - Pen Input capture for sign-offs, same "real control" approach

Found something in this post that doesn't match what Studio does on your tenant? Send feedback, I retest claims like this one for a living.

Power Apps File Upload Without a Form: The Attachments Control Myth | PowerLibs Tutorials