In this PowerApps tutorial, We will discuss what is Attachments control in PowerApps, What are the important Powerapps Attachment Control properties and all the Powerapps Attachment Limits.
Also, by taking a simple scenario, We will see these below things that are related to Powerapps Attachment Control as:
- How to add attachment control in Powerapps
- Use of PowerApps Email Attachments with the office 365 connector
- How to use Powerapps Attachment Control Collection
- Powerapps patch attachments
- What is Custom attachment control in Powerapps
- Powerapps add an attachment to SharePoint list or Powerapps upload attachment to SharePoint
- Powerapps clear attachment control
Powerapps Attachment Control
Powerapps Attachment Control is a type of control that helps to users to upload and delete the files from the SharePoint list or a Common Data Service entity.
Also, this control allows the users to download and open any files from their device.
Powerapps Attachment Control Properties
Below represents some important and useful Powerapps Attachment Control properties as:
- Items: This property specifies the files that can be downloaded.
- MaxAttachments: The control will accept the maximum number of files.
- MaxAttachmentSize: Currently, the maximum attachment file size limit is 10 MB.
- OnAddFile: When a user adds a new file attachment, it specifies how the app responds.
- OnRemoveFile: When a user deletes an existing attachment, it specifies how the app responds.
- OnUndoRemoveFile: When a user restores a deleted attachment, it specifies how the app responds.
- AddAttachmentText: This property specifies the label text for the link used to add a new attachment.
- DisplayMode: It specifies whether the control allows adding and deleting files (Edit), only displays data (View), or is disabled (Disabled).
- MaxAttachmentsText: When the control contains the maximum number of files allowed, the text that replaces the “Attach file” link.
- NoAttachmentsText: If there are no files attached in the attachment control, then an informational text shown to the user.
- TabIndex: It specifies the Keyboard navigation order in related to other controls.
- Visible: This property specifies whether the attachment control is visible or hidden.
Powerapps Attachment Limit
There are certain limitations present while a user is working with the Powerapps Attachment Control. Such as:
- In the Powerapps Attachment control, you can upload the files up to 10 MB or smaller. Otherwise, If the file size exceeds 10 MB, then the control will not take the specific file.
- Powerapps Attachments are only supported by the Common Data Service entities and SharePoint lists.
- When the Powerapps Attachment control is in Edit mode and not inside a form, then it appears disabled. The Upload and Delete functionality works only inside a form. The app user must save the form to save the file additions and deletions.
- Powerapps Attachment Control is not available in the Powerapps Insert tab. It only appears in the form when the Attachment form field is enabled in a SharePoint or Common Data Service form.
Add Attachment Control in Powerapps
To add the Attachment Control in Powerapps, follow the below steps that we need to do:
- Sign in the PowerApps app with your credentials.
- Create a blank new Canvas app and choose any one Layout either Tablet or Phone.
- On the Powerapps Blank screen, Add a Powerapps Form (Either Edit or Display form) and connect the SharePoint list data source.
- Select the Edit or Display form -> Select the Data Source in the Properties tab in the options panel from the Right -> Select the SharePoint Site -> Choose SharePoint List that you want to connect -> Click on Connect button.
- Select Edit fields in the Fields section -> Click on the + Add field.
- Select the Attachments field and select Add.

- The Attachments field or control is only available with the SharePoint list that will appear in the form as you can see in the below screenshot.

PowerApps Email Attachments with the office 365 connector
Suppose in your organization, you want to send a single or multiple Email attachment files to any user. In this case, you can use the Powerapps Office 365 Connector. See this below screenshot for your reference:

Follow these below steps to work with the PowerApps Email Attachments with the office 365 connector.
On the Powerapps screen, Add these below input controls as:
- To:
- Add one Label and set its Text property as “To:”.
- Insert a Combo box (Insert -> Input -> Combo box) and connect the Data source with Office365Users connectors.
- Select the Combo box and set its Items property as:
Items = Office365Users.SearchUser({searchTerm:ComboBox1.SearchText,top:10})
Where,
ComboBox1 = Combo box control name
NOTE:
If you want to know more details about the Powerapps Combo box and Office 365 Users Connector, then follow this link: Create People Picker in PowerApps with Combo Box
2. Email Subject:
- Add one Label and set its Text property as “Email Subject:“.
- Insert one Text input control and set its Default property as blank.
3. Email Body:
- Add one Label and set its Text property as “Email Body:“.
- Insert one Text input control and set its Mode property as “TextMode.MultiLine“.
- Select the Text input control and set its Default property as blank.
4. Attach file:
- Add one Label and set its Text property as “Attach file:“.
- Connect the SharePoint Data source connector (View -> Data Sources -> SharePoint -> Add a new or existing connection).
- Select the SharePoint Site -> Choose any SharePoint List -> Hit on the Connect button. Then the specific SharePoint list will be added as shown below.

- On the Powerapps screen, Insert one Edit form (Insert -> Forms -> Edit) -> Go to Properties tab -> add the SharePoint List data source (Company Info).

- When you will add the SharePoint List to the Edit form, By default an Attachment file also will add. Unlock the Attachments Data card -> Cut (Ctrl+X) and paste (Ctrl+V) the Attachment Data card outside of the Edit Form.

- Next, Remove the Edit form and rename this Attachment control to EmailAttachment.

When you will move the Attachment data card to outside, then some error will appear on the data card properties as you can see in the above screenshot. Select the Attachment control and fix these below issues as:
- BorderColor: RGBA(89,0,0,1)
- Items: Just Remove it and make as Blank
- Tooltip: Just Remove it and make as Blank
- DisplayMode: DisplayMode.Edit
Next, We need to add a button where you can send an Email attachment once the user clicks on it.
- Connect the Data source as Office 365 outlook (View -> Data sources -> Office365Outlook)
- Insert a Button (Insert -> Button) and set its Text property as “Send an Email“.
- Select the Send an Email button and set its OnSelect property as:
Where,
OnSelect = Office365Outlook.SendEmailV2(
ComboBox1.Selected.Mail,
txtEmailSubject.Text,
txtEmailBody.Text,
{
Attachments: AddColumns(
RenameColumns(
EmailAttachment.Attachments,
"Value",
"ContentBytes"
),
"@odata.type",
""
)
}
)
- Office365Outlook.SendEmailV2 = It is a Powerapps connector that helps to send an Email via Office365Outlook.
- ComboBox1.Selected.Mail = It specifies to whom you want to send the Attachment email. ComboBox1 is the name of the Combo box control.
- txtEmailSubject.Text = txtEmailSubject represents the Email subject input control name and it specifies what the subject line you want to send to the user via Email.
- txtEmailBody.Text = txtEmailBody represents the Email body input control name and it specifies what the body part you want to send to the user.
- Attachments = It helps to store the attachment files
- AddColumns = It helps to add the columns
- RenameColumns = It helps to rename the columns
- EmailAttachment.Attachments = EmailAttachment represents the Attachment control name
- Value = Here, we need to pass the Name and Value column. So the Rename column is going to take an existing column and rename it.
- ContentBytes = Also, it is expecting a Value column i.e. Content Bytes. So renamed as it “Value” and made it as “ContentBytes”.
- @odata.type = It is the data type and make it as blank.
Once you will hover these formula in the formula bar, then you will see a Table where it contains the Name, ContentBytes and @odata.type as shown in below:

Preview the App and Test with Attachment Control
Preview (F5) the Attachment file app. Specify the To field, Email Subject field, Email Body field value.
Attach some files from your desktop by using the Attach file option. You can attach only those files whose size limit is 10 MB. Click on the Send an Email button as shown below.

Now the specific user (Preeti) will get the Powerapps Email attachments as like the below screenshot.

Powerapps Attachment Control Collection
Suppose you want to store the Powerapps Attachment files in the Powerapps Collections. Then you need to do these below things as:
- Add a Button and set its Text property to “Collect Attachment Files“.
- Select the Button and apply this below formula on its OnSelect property as:
OnSelect = ClearCollect(attachmentFiles,EmailAttachment.Attachments)
Where,
- ClearCollect = This function helps to create a Powerapps collection where always it clears the previous value and stores the new one
- attachmentFiles = Collection Name
- EmailAttachment = Attachment control name

Next, Preview (F5) the app and Attach one or multiple files from the system. Click on the Collect Attachment Files button.

Open the Powerapps Collections (View -> Collections) and click on the Collection name (AttachmentFiles). You can view the Powerapps attachment files as shown below.

Powerapps patch attachments
Here by taking a simple scenario, I will explain you how to use the Powerapps Patch attachments.
If you want to add an attachment to a SharePoint List using Powerapps Patch function, then this is known as PowerApps Patch Attachments.
- As there is no way to add the Powerapps Attachment control directly in the Powerapps screen, So we need to add a Powerapps Form (Either Edit or Display Form).
- Next, Connect the SharePoint Data source and choose your specific SharePoint list where you want to add the Attachments.
- Go to Edit fields from the Fields section. Add the Attachment field (By default, this attachment control has been added automatically).

- Insert a Button in the form and set its Text property to Submit.
- Select the Submit Button and apply this below formula on its OnSelect property as:
OnSelect = Patch(
'Company Info',
Defaults('Company Info'),
{
Title: DataCardValue1.Text,
Attachments: DataCardValue3.Attachments
};
Form1.Updates
)
Where,
- Patch = Patch function is used to modify single or multiple records of a data source
- ‘Company Info’ = SharePoint List Name
- Defaults(‘Company Info’) = Defaults function helps to create a new item or record in the SharePoint list (Company Info)
- Title:DataCardValue1.Text = Title represents the SharePoint List column name and the DataCardValue1 represents the Title input field name
- Attachments: DataCardValue3.Attachments = Attachments represents the SharePoint List column name where the files will save and the DataCardValue3 represents the Attachment control name
- Form1.Updates = Form1 is the Edit form name that will update
Refer this below screenshot:

- Preview (F5) the app. Click on Attach file from the Attachment control and select one or multiple files from your system.
- Enter Company Name (just renamed the Title column) and hit the Submit button.

- Next, go to the SharePoint list (Company Info) and refresh it. You can see the new item has been added to that list.
- When you will open the item Details Pane, then you can view all the Powerapps Attachment files that you have inserted as shown below:

Custom attachment control in Powerapps
Powerapps Attachment Control is a powerful hidden control because we know that we can get this control inside a Powerapps Edit form or a Display form. There is no input Attachment control available in the Powerapps Insert tab.
So if you want to view the Attachment File name and Attachment File Content, then we need to do these below things as:
- On the Powerapps screen, Insert one Label control and set its Text property as:
Text = First(EmailAttachment.Attachments).Name
Where,
EmailAttachment = Attachment Control Name
- Insert one Image control (Insert -> Media -> Image) and set its Image property as:
Image = First(EmailAttachment.Attachments).Value
- Preview (F5) the app. Add a file (suppose an Image file) to the Attachment control. In the Label control, you will see the Attachment File name. Similarly, In the Image control, you will see the Attachment File content as shown below.

Powerapps add an attachment to SharePoint list
You can easily add single or multiple attachment files to a SharePoint list or library. As we discussed above, the Powerapps Attachment control only appears inside the Edit or Display Form.
So to add the Powerapps attachment files in a SharePoint List, We need to do very simple things as:
- Connect the SharePoint Data source connector (View -> Data Sources -> SharePoint -> Add a new or existing connection).
- Select the SharePoint Site -> Choose any SharePoint List -> Hit on the Connect button. Then the specific SharePoint list will be added.
- Insert one Edit form (Insert -> Forms -> Edit) -> Go to Properties tab -> add the SharePoint List data source (Company Info).
- You can see, By default, an Attachment file has been added in the Powerapps Edit form. So you do not need to do anything for the attachment. Just unlock it.
- Insert one Button and set its Text property to “Submit Record in SharePoint List“.
- Select the button and set its OnSelect property as:
OnSelect = SubmitForm(Form1);
Where,
Form1 = Edit form name
Next, Preview the app and add some attachments to the Attachment control. Click on the button (Submit Recod in SharePoint List).

Now the new record has been added to the SharePoint List. Go to the SharePoint list (Company Info) -> Select the new item -> Click on the Details pane -> you can view all the Powerapps attachments under the Properties section as like the below screenshot.

Powerapps clear attachment control
Most of the time you can see users are clearing or resetting the previous attachments by using the cancel icon (from the Attachment control itself). But there are some users who do not want to clear the attachments individually by using the Cancel icon.
To clear the attachments from the Attachment control, We can take a button and when a user will click on the button, then all the attachments will clear from the Attachment control. Follow these below things:
- Insert a Button and set its text property to “Reset“.
- Select the Reset Button and set its OnSelect property as:
OnSelect = ResetForm(Form1);NewForm(Form1)
Where,
Form1 = Edit form name
Preview the app and click on the Reset button. Then you can see all the attachment files will clear from the attachment control at a time.
Also, you may like these below Powerapps Tutorials:
- PowerApps Popup message Box with Examples
- Get users from SharePoint Group in PowerApps
- PowerApps camera control + Save captured image in SharePoint
- PowerApps role based security SharePoint example (SharePoint Groups)
- PowerApps: Submit data to two SharePoint Lists
- PowerApps set field value based on another field
- Embed PowerApps in SharePoint modern page
- Show hide fields based on dropdown selection PowerApps
- How to use date time picker in PowerApps
- PowerApps toggle control + How to use with example
- Build PowerApps Quiz App – Step by Step
In this PowerApps tutorial, We discussed what is PowerApps Attachments control, Powerapps Attachment Control properties.
Also, We saw these below things that are related to Powerapps Attachment Control as:
- Powerapps Attachment Limitations
- Add attachment control in Powerapps
- PowerApps Email Attachments with the office 365 connector
- How to use Powerapps Attachment Control Collection
- Powerapps patch attachments
- Custom attachment control in Powerapps
- Powerapps add an attachment to SharePoint list or Powerapps upload attachment to SharePoint
- Powerapps clear attachment control
I am Bijay a Microsoft MVP (8 times – My MVP Profile) in SharePoint and have more than 15 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com
How to get the File Size value saved into Label.
nice one. May i know how do we pass the attachment to the dynamics crm timeline/notes ?
I can’t seem to make the patch code patch. I put Attachments in as the column, the data card name and .Attachments. I know I’m selecting the right name because it even suggests putting Attachments after the dot.
It then gives a re line stating, “The type of this argument ‘{Attachments}’ does not match the expected type ‘Attachment’. Found type ‘Table’. The function ‘Patch’ has some invalid arguments”
So, then I changed the column name to Attachment (singular) to see if that made a difference and, of course, it states that column doesn’t exist and the most similar name is ‘Attachments’
Any thoughts?
Hello Bijay. Can we set Attachment control(outside of form control) to display a document from sharepoint doc lib? I tried to set its items property but it does not download the file. Any suggestions on this ?
Hi what do i do if I don’t have an attachment field after adding my SharePoint list in the adds fields section. I have everything else but not attachment
I’m receiving an error and I’m not sure what I’m missing “On Select” for my send email icon – any tips would be greatly appreciated.
Invalid number of arguements: Received 5; Expected 3 – 4.
Set(_emailRecipientString, Concat(MyPeople, Mail & “;”));
Office365Outlook.SendEmail (_emailRecipientString, TextEmailSubject1.Text, TextEmailMessage1.Text, {Importance:”Normal”},{Attachments:AddColumns(
RenameColumns(
EmailAttachment.Attachments,
“Value”,
“ContentBytes”
),
“@odata.type”,
“”
)
};
Reset(TextEmailSubject1);
Reset(TextEmailMessage1);
Clear(MyPeople)