Attachments control in Power Apps
An attachment control allows users to download files to their device, as well as upload and delete files from a list created using Microsoft Lists, or a Microsoft Dataverse table. The Collections and Tables are not supported.
Add an Attachment control to the Power Apps
The following are the steps to add the attachment control to the form in power apps:
Step 1: Add a form to our app, and set a list as its data source.
Step 2: Select the Display Form control in the tree view on the left-hand side. We can also use Edit Form instead.
Step 3: Select Data Source in the Properties tab in the options panel on the right and then select the list or dataverse we connected to.
Step 4: Select Edit fields in Fields section and select Add field.
Step 5: Select the Attachments field and select Add. The Attachments field is not available if the Enable attachment is not checked in dataverse table.
The Attachments field associated with the list will appear in the form.
There are the following properties of an attachment control:
1. Items The Attachment column of the list or Dataverse table.
2. MaxAttachments The MaxAttachments property specifies the maximum number of files the control will accept.
3. MaxAttachmentSize The MaxAttachmentSize property specifies the maximum allowed file size in MB of each new attachment. 1 MB here is 1,000,000 bytes (106 B) or 1,000 KB.
4. OnAddFile The OnAddFile property specify the actions to perform when the user adds a new file attachment.
5. OnRemoveFile The OnRemoveFile property specifies the actions to perform when the user deletes an existing attachment.
6. OnUndoRemoveFile The OnUndoRemoveFile property specifies the actions to perform when the user restores a deleted attachment.
7. AddAttachmentText The AddAttachmentText specifies the label text for the link used to add a new attachment.
8. MaxAttachmentsText The MaxAttachmentsText specifies the text that replaces the "Attach file" link when the control contains the maximum number of files allowed.
Here, the Maximum limit is 6 files, when this reach the limit, the text shown is MaxAttachmentsText.
9. NoAttachmentsText The NoAttachmentsText specifies the informational text shown to the user when there are no files attached.
10. Size The Size property specifies the font size of the text that appears on a control.