NewPower Apps · canvas componentInputs and forms✓ Tested in StudioMIT License
Attachments list with upload
Adds files and lists the ones already attached: a drop card to choose or drag files in, each with a status and the reason when one can't go, remove and undo for attached files, and one Upload button that hands it all to your app. Light and dark, with motion.
- Name in Studio
- lcsAttachmentList
- Version
- 0.2.0
- Properties
- 16 inputs · 8 outputs · 3 events
Variations
As it is when you paste it, with every input at its default.
Choose filesor drag them here
Up to 10 MB each · 3 files at most
· Count: 2 · ReadyCount: 0 · HasChanges: false
Formulas on this screen
Set the same ones in Studio to try it the same way; there, each Notify shows its event in a banner, which this preview leaves out so nothing covers the component. The instance names are the ones Studio gives the first copy on a screen.
lcsAttachmentList_1.OnSave = Notify("Upload " & Ready & ", remove " & Removed); Reset(lcsAttachmentList_1)
lcsAttachmentList_1.OnOpen = Notify("Open " & Name)
A web replica that behaves as the component does in Power Apps. In Studio it uses Microsoft's controls, which can look slightly different.
Add it in five steps
- In Power Apps Studio, open Settings > Updates and check that Modern controls and themes and Enhanced component properties are on.
- Open the Components tab in the tree view and select New component.
- Select an empty part of Studio, so the new component isn't selected.
- Copy the YAML on this page and press Ctrl+V.
lcsAttachmentListappears with all its properties. - On a screen, insert it from Insert > Custom >
lcsAttachmentList.
What it needs
- No premium licence: standard controls, no connectors
- Modern controls and themes: on
- Enhanced component properties: on
- Tested in Power Apps Studio 3.26094.9 on October 17, 2026
- Version 0.2.0
Properties (27)
Read from the component's own YAML, so they always match what you paste.
| Property | Kind | Type | Default |
|---|---|---|---|
TitleThe heading at the top of the card. | Input | Text | "Upload documents" |
SubtitleA line under the heading. Empty shows none. | Input | Text | "Add the files for this request" |
FilesThe files already attached, as a table with Key, Name, Size (bytes, 0 when unknown), Url (a link that opens the file, or empty), Who and When columns. | Input | Table | Table({Key: "f1", Name: "Site survey.pdf", Size: 1843200, Url: "", Who: "Dana Kaur", When: DateAdd(Now(), -2, TimeUnit.Days)}, {Key: "f2", Name: "Notes.docx", Size: 23552, Url: "", Who: "Sam Okafor", When: DateAdd(Now(), -20, TimeUnit.Minutes)}) |
AcceptedTypesThe file types people can add, as extensions separated by commas, such as pdf,docx,xlsx. Shown as chips; another type is added with a reason and isn't uploaded. Empty accepts any type. | Input | Text | "pdf,docx,xlsx,png,jpg" |
MaxFilesThe most files people can add before they upload. Files already attached don't count. | Input | Number | 3 |
MaxFileSizeThe largest file in megabytes (1 MB is 1,000,000 bytes). Power Apps' Attachments control refuses a bigger file with its own message. | Input | Number | 10 |
AllowUploadShows the drop card and the Upload button. Off, the card lists the files already attached. | Input | Boolean | true |
AllowRemoveShows a remove button on each file already attached. Removing marks the file, with Undo, until the changes are saved. | Input | Boolean | true |
IsUploadingSet it to true while your app saves (in OnSave), and back to false after: each file shows a moving bar, the button spins, and nothing can be changed. | Input | Boolean | false |
ShowMetaWhich details show under a file already attached: size, who, when, or any of them separated by commas. Empty shows none. | Input | Text | "size,who,when" |
OpenOnSelectOpens an attached file's Url in a new tab when its row is selected, before OnOpen runs. Off, only OnOpen runs. | Input | Boolean | true |
EmptyTextWhat the card says when AllowUpload is off and nothing is attached. | Input | Text | "No files yet" |
MaxHeightThe most height the files already attached take before they scroll. 0 grows with the list. | Input | Number | 0 |
AccentColorYour brand colour, for the drop card, the button, the focus rings and files of a type without a colour of its own. | Input | Color | RGBA(15, 108, 189, 1) |
ThemeLight, or Dark for a dark screen. | Input | Text | "Light" |
MotionThe arrow bobs when the card appears, tiles pop in, ticks draw in, and bars move while uploading. None plays for people who've asked their device for reduced motion. | Input | Boolean | true |
| Property | Kind | Type | Default |
|---|---|---|---|
CountHow many files are already attached. | Output | Number | — |
TotalSizeThe attached files' sizes added up, in bytes. | Output | Number | — |
TotalSizeTextThe total size as people read it, such as 1.8 MB. | Output | Text | — |
ReadyCountHow many added files are ready to upload. | Output | Number | — |
StagedFilesThe files ready to upload, with Name and Value as Power Apps' Attachments control gives them: for a SharePoint item's attachments or a Dataverse file column. | Output | Table | — |
StagedFilesDataThe files ready to upload as Name and ContentBytes (base64), for a flow that takes text. Built when the Upload button is selected, so read it in OnSave. | Output | Table | — |
RemovedKeysThe Key of each attached file marked for removal, in a Key column. | Output | Table | — |
HasChangesTrue while there are files to upload or files to remove. | Output | Boolean | — |
| Property | Kind | Type | Default |
|---|---|---|---|
OnOpen(Key, Name, Url)Runs in your app when an attached file's row or Open is selected, with its key, name and link. Open a file your own way here, such as through a flow.
| Event | — | false |
OnSave(Ready, Removed)Runs in your app when Upload is selected, with how many files to upload and to remove. Save StagedFiles (or StagedFilesData for a flow) and remove RemovedKeys, with IsUploading true while you do, then Reset this component.
| Event | — | false |
OnCancel(Discarded)Runs in your app after Cancel has cleared the added files and the removals, with how many changes were dropped.
| Event | — | false |
Guide
Use lcsAttachmentList wherever people add files to a record: a request's quotes and photos, a case's documents, an expense's receipts. Two questions come up again and again on the forums: "how do I upload files outside a form?" and "how do I show the attachments, with a remove button, in a nice list?". This component answers both in one card:
- A drop card at the top: choose files, or drag them onto it on the web. It shows the accepted types as chips and the limits under them, and it lights up in your colour while a file is dragged over it;
- Each added file as a row with its type tile, and a status: a green tick for Ready to upload, or a red row with the reason it can't go (a type you don't accept, a file that's already attached). A round button takes it off again;
- The files already attached from your table (
Key,Name,Size,Url,Who,When), each with Open, and a remove button that marks the file, with Undo, until the changes are saved; - One Upload button ("Upload 2 files") that runs
OnSave(Ready, Removed)in your app, with how many files to upload and to remove. Your app saves the files and the removals, shows progress withIsUploading, and resets the card when it's done. Cancel clears the changes and runsOnCancel(Discarded); ReadyCount,StagedFiles,StagedFilesData(the files as base64 for a flow),RemovedKeys,HasChanges,CountandTotalSizefor the rest of your screen.
It's built on Power Apps' classic Attachments control, the same way as many makers' own upload components: the control is the click-and-drop target across the drop card, and the component keeps the files you add until you save them.
The examples call it alRequest on a request's screen, with galRequests listing the requests.
The files already attached, from the selected item's SharePoint attachments:
// alRequest.Files
ForAll(
galRequests.Selected.Attachments As a,
{Key: a.Name, Name: a.DisplayName, Size: 0, Url: a.Value, Who: "", When: Blank()}
)
Save through a flow that takes text (one run per file), with progress while it runs. SaveRequestFile and DeleteRequestFile stand for your own flows:
// alRequest.IsUploading
varSavingFiles
// alRequest.OnSave
Set(varSavingFiles, true);
ForAll(
alRequest.StagedFilesData As f,
SaveRequestFile.Run(galRequests.Selected.ID, f.Name, f.ContentBytes)
);
ForAll(alRequest.RemovedKeys As k, DeleteRequestFile.Run(galRequests.Selected.ID, k.Key));
Set(varSavingFiles, false);
Reset(alRequest);
Notify(Ready & " uploaded, " & Removed & " removed", NotificationType.Success)
StagedFilesData is built when Upload is selected, so read it in OnSave. If your flow's trigger takes a file instead of text, send each row of StagedFiles (its Name and Value) and skip the base64.
One file into a Dataverse file column, with the record Microsoft's docs build for a file column (FileName and Value):
// alDocument.MaxFiles
1
// alDocument.OnSave
Patch(
'Project Documents',
galDocuments.Selected,
{'Document File': {FileName: First(alDocument.StagedFiles).Name, Value: First(alDocument.StagedFiles).Value}}
);
Reset(alDocument)
Accept only some types, and change the limits:
// alRequest.AcceptedTypes
"pdf,docx,xlsx,jpg,png"
// alRequest.MaxFiles
5
// alRequest.MaxFileSize
20
A list people can open but not change:
// alRequest.AllowUpload
false
// alRequest.AllowRemove
false
- Columns.
Fileswants exactlyKey,Name,Size,Url,WhoandWhen; build the rows withForAllas in Use it.Sizeis bytes; pass 0 when the source doesn't give it, and the size is left out of the details. - Notes with files (the Notes table): list them with
Filter(Notes, Regarding = varRequest),'File Name'asName,'File Size (Bytes)'asSize,'Created By'.'Full Name'asWhoand'Created On'asWhen. A note has no link the app can open directly, so leaveUrlempty, setOpenOnSelectoff, and open it through a flow inOnOpen. - A file column holds one file per record: set
MaxFilesto 1 and patch it as in Use it. - Opening files. The row opens
UrlwithLaunch, in a new tab, where the browser's own sign-in applies. Power Apps can't attach your sign-in to a download itself, so a link that needs authentication works in the browser and may not in the mobile app; test on the devices your people use.
- The drop card is Power Apps' Attachments control, named with your title and "add files", so a screen reader says what it's for.
- Each added file is named with its status as text ("Ready to upload", "Not accepted: MP4 isn't an accepted type"), with an icon beside it, so it's never colour alone; each remove button is named "Remove" and the file's name.
- Each attached file is a button named "Open" or "Select" and the file's name, plus "removed when you save" when it's marked; Open, Remove and Undo are buttons with their own names.
- The summary next to the buttons ("2 ready · 1 to remove") says what Upload will do.
- With
Motionon, the arrow in the drop card bobs three times when the card appears, tiles pop in, the ready tick draws itself in, a refused file's mark shakes once, the count pops when it changes, and bars move while your app uploads. None plays for people who've asked their device for reduced motion, andMotionoff shows everything at once.
- Uploading outside a form. Microsoft documents the classic Attachments control's upload inside a form only. Makers use it outside one, as this card does; try adding files in Preview (F5) and in your published app before you rely on it.
- File sizes. The Attachments control doesn't give a file's size before it's saved, so added files show no size. It refuses a file over
MaxFileSizeitself, with its own message. Power Apps' 1 MB is 1,000,000 bytes. - Types are checked by the extension in the file's name, not its contents. Keep checking files where you store them.
- One card per screen. "Access app scope" is on, so the added files are kept in the app's collections
colLcsAttachStaged,colLcsAttachRemovedandcolLcsAttachPayload, and two cards on one screen would share them. Paste the component into the app itself, not into a component library, where app scope isn't available. - On Power Apps Mobile, people add files one at a time (a limit of the Attachments control).
- The card keeps room for three added files; more scroll in that space. Rows are 64 pixels each; with
MaxHeight0 the attached files grow the card, so put it on a scrollable screen when files are many, or setMaxHeight. Launchopens the link in a new tab; in the mobile app it opens the device's browser. There's no in-app preview.
- 0.2.0: adds files. A tonal drop card (choose or drag) with the accepted types and limits, added files with their status and reason, attached files marked for removal with Undo, Cancel and one Upload button,
OnSave(Ready, Removed),OnCancel(Discarded),IsUploading,ReadyCount,StagedFiles,StagedFilesData,RemovedKeysandHasChanges.ShowRemove,OnRemove,Select,ClearSelectionandSelectedKeyare gone: removing is saved with Upload. - 0.1.0: first version: rows from a table, the typed icon, the details, Open and Remove, the empty state,
OnOpen,OnRemove,Select,ClearSelection, the outputs, light and dark, the icon motion.
Did it work for you?
No ratings yet.Nobody has said it worked in their app yet.
Sign in to rate it or to say it worked in your app.
Comments
No comments yet. Share how you used it, or ask something.
Sign in to comment or reply. Comments show under a display name you choose, never your email.