cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

How to add document library attachment to list on SharePoint

Hi,

 

I have a document library which stores a file only. The name of the file is the same name as the title on a SharePoint List  - I need to run a flow that will assign that doc library attachment to the specific SharePoint list item where the attachment name = title.

 

Any help would be great - thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Hi @Blurryface 

Follow the steps below

1. I had used the trigger 'When a file is created or modified'

2. Add the action 'Get file content using path' to get the contents of the file. For the 'File Path' property pass the 'Full Path' from the above trigger action.

sudharsan1985_0-1600519326188.png

3. Use the action 'Create Item' to create the item. For title choose 'Name' property from the trigger condtion.

sudharsan1985_1-1600519403279.png

4. Add the action 'Add Attachment'. Choose the following properties

   1. Id - Choose the ID from the 'Create Item' output.

   2. File Name - Choose the 'File name with extension' from the trigger output.

   3. File Content - Choose the output from the 'Get file content' action added in step 2.

sudharsan1985_2-1600519557652.png

 

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

View solution in original post

2 REPLIES 2
Super User
Super User

What is the trigger are you using? When a new document is uploaded to library?

 

In the flow you can use Get Item and in the filter query you can write title = '<select name property from Library trigger>'

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
Super User
Super User

Hi @Blurryface 

Follow the steps below

1. I had used the trigger 'When a file is created or modified'

2. Add the action 'Get file content using path' to get the contents of the file. For the 'File Path' property pass the 'Full Path' from the above trigger action.

sudharsan1985_0-1600519326188.png

3. Use the action 'Create Item' to create the item. For title choose 'Name' property from the trigger condtion.

sudharsan1985_1-1600519403279.png

4. Add the action 'Add Attachment'. Choose the following properties

   1. Id - Choose the ID from the 'Create Item' output.

   2. File Name - Choose the 'File name with extension' from the trigger output.

   3. File Content - Choose the output from the 'Get file content' action added in step 2.

sudharsan1985_2-1600519557652.png

 

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

View solution in original post

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (7,661)