In this Power Automate tutorial, I will show you, how to add attachments to SharePoint list items using Power Automate. Also, we will discuss, how to add multiple attachments to a SharePoint Online list item using a flow or Power Automate.
In the last, I will show you, how to add email attachments to a SharePoint list item using Power Automate. Also, I will explain, how to add attachments from one drive to SharePoint list items using Power Automate.
By default, the attachment column is not visible in the SharePoint list view, to view attachments we need to enable it. To enable the attachment column in the SharePoint list:
Open the SharePoint list view, click on + Add column –> Show/hide columns. Then select the Attachments and click on the Apply button.
Once the attachment column has been added to the SharePoint List view, it looks like the below:
Add attachments to a SharePoint list item using Power Automate
Here we will see how to add attachments to a SharePoint list item using Power Automate.
In this example, we will add four input fields called Employee ID, Employee name, and Employee status which is of text type, and the Attachment which is of File content type in the trigger action.
Once the Flow Triggers, a new item will be created in the SharePoint list along with an attachment.
- Login to Power Automate, and create an instant cloud flow. Expand the trigger and pass the input values.
- Then we will add a text input for Employee ID, Employee name, and Employee status and a file content input for an attachment.
- Select the new step and add a create item action and Provide the SharePoint site address and the list name.
- Now Pass the dynamic content values for the Title, EmpName, and EmployeeStatus fields
- Select the new step, choose Add attachments, and pass the created SharePoint list item ID.
- Then add the File Name and select the File content from the dynamic content values.
Save and Test the flow. Enter the Employee ID, Employee Name and Employee Status details and click on the Run flow:
Our flow ran successfully, and an item will be created in the list item with an attachment.
The screenshot below shows that the new list item has been added along with the Attachment in the SharePoint list.
This is how to add attachments to the SharePoint list item using Power Automate.
Add Multiple attachments to a SharePoint list item using Power Automate
Here we will see how to add multiple attachments to the SharePoint list item using Power Automate flow.
First, we will create a SharePoint document library and the multiple files to it, Once the flow triggers it reads all the files from the document library and create a new list item along with the multiple attachments.
Here I have created a document Library as “Files to be Attach” and added multiple files to the library.
Follow the below steps, to add multiple attachments to the SharePoint list item:
Step:1
Create an instant cloud flow, Expand the trigger, and Add a text input for EmpID, EmpName, and Employee Status.
Step:2
Now we will initialize a variable by selecting initialize variable action and later we use it in our flow, Enter the Variable name and choose the variable type as Array.
- Name: Provide the variable name
- Type: Type of variable
Step:3
Choose the Get files(Properties Only) action from action triggers. Configure the SharePoint site address and the library name.
- Site Adress: Provide the site address
- Library Name: Select your library name
Step:4
- Select the Get File content action and pass the identifier from the previous step as a dynamic content value.
- It will automatically changes apply to each action based on the files presented in the library.
Step:5
We will add a compose data operation and pass the JSON values to get the file name and folder path and file type for all the files presented in the document library.
{
"inputs": {
"alias": "@items('Apply_to_each')?['{Name}']",
"resourceLink": "@items('Apply_to_each')?['{Path}']",
"type": "Other"
}
}
Step:6
Now select an Append to an array variable action select the initialized array and pass the output of the compose action.
Step:7
Select the New step and add a compose action and pass the Ouputs of the variable action.
Step:8
Choose a create item action and configure the SharePoint site address and list name and pass the Dynamic content values for EmpID, EmpName, and Employee Status.
Step:9
- Add a new step and choose the Add attachment action and Provide the required fields like SharePoint site address, SharePoint list name, ID, and File name with extension.
- In the File content field, pass the output of the File content Values compose data operation.
Step:10
Save and Test the flow by selecting the run flow option. Provide EmpId, EmpName, and Employee Status, and Click on the Run flow option.
Once the flow ran successfully like below:
We can a new SharePoint list item has been added along with Multiple attachments using flow:
This is how to add multiple attachments to the SharePoint list item using Power Automate flow.
Add email attachment to SharePoint list Using Power Automate
Let us see how to add email attachments to the SharePoint list item using Power Automate.
Here we will use the default template named ‘Create item and add attachments to a SharePoint list on a new email arrival‘ on Power Automate. Choose the template and then click on Continue to create an automated flow:
Make sure the SharePoint list has been created. Here we will use the training Feed back list below which has a Name(Title column) and Attachments column.
- Expand the new email arrives trigger action and choose the inbox folder in the section.
- In the same way, select create item action and configure the SharePoint site address and list name.
Again, in the Add attachment action, insert the SharePoint Site address and List name:
Save and test the Power Automate flow, by selecting the Test flow option and sending an email to Outlook along with the attachments. Once the flow ran successfully like below:
We can see the new item has been created with an attachment in the SharePoint list.
This is how to add email attachments to the SharePoint list item using Power Automate.
Add attachment from one drive to SharePoint list item using Power Automate
Now, let us see, how to add an attachment from one drive to a SharePoint list item using Power Automate.
In this example, we will use the Training Feedback list consisting of the Name and Attachments column.
- Name – Default title column
- Attachments – Attachment Column
Here we will create a flow to add attachments to the SharePoint list item from one drive using Power Automate,
- Login to Power Automate, and create an instant cloud flow. Expand the trigger and add an input value Name which is of Text data type.
- Then we will use create item action to add a list item to the SharePoint list. Configure the SharePoint site Address and List Name.
- And pass the dynamic content value Name in the Title field.
Add a new step and select Get the file contents using OneDrive’s Get File content action from action triggers.
- Select the new step, choose Add attachments action, and pass the created SharePoint list item ID.
- Then Enter the File Name and select the File content from the output of the get file content action.
Save and Test the flow. Enter the input Name value and click on the Run flow:
Our flow ran successfully, and an item will be created in the list item with an attachment.
The screenshot below shows that the new list item has been added along with the Attachment in the SharePoint list.
This is how to add attachments to the SharePoint list item from one drive using Power Automate.
Example-2
Here we will see another example, to add an attachment to the SharePoint list from one drive with an extension using Power Automate.
We will use the same Training Feedback list consisting of the Name and Attachments column.
Here when we get file content from One Drive, we will add a file extension along with the attachment. Follow the below steps, to achieve it
- Login to Power Automate, and create an instant cloud flow. Expand the trigger and add the text input value for Name.
- Then we will use create item action to add a list item to the SharePoint list. Provide SharePoint site Address and List Name.
- And Pass the dynamic content value for the Name in the Title field.
Add a new step and select Get the file contents using OneDrive’s Get File content action from action triggers.
- Select the new step, choose Add attachments, and pass the created SharePoint list item ID.
- Then Enter the File Name with the extension and select the File content from the output of the get file content action.
Save and Test the flow. Enter the input value and click on the Run flow:
The screenshot below shows that the new list item has been added along with the Attachment in the SharePoint list.
This is how to add an attachment to the SharePoint list from one drive with an extension using Power Automate.
In this Power Automate tutorial, we saw how to add an attachment from one drive to a SharePoint list item using Power Automate with examples.
Conclusion
In this Power Automate tutorial, we saw how to add attachments to a SharePoint list item using Power Automate. Also, we covered below examples as well:
- Add Multiple attachments to the SharePoint list item Power Automate
- Add email attachment to SharePoint list item Power Automate
- Add attachment from one drive to SharePoint list item using Power Automate
You may also like:
- How to Merge Word Documents in Power Automate?
- remove an item from an array in Power Automate
- How to read a text and count its occurrence from a docx file in Power automate?
- Format date to iso 8601 in Power Automate
- convert base64 to an image file in Power Automate
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.