cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kpiana
Level: Powered On

Automated Flow Duplicate List Attachments to a Library

Hello Community,

 

I am trying to build a Automated Flow that will automatically duplicate attachments from a list to a Library. When ever a attachment is added or modified to the list it needs to update the same file and properties in the Library. Additionally it would need to copy the properties from the custom columns from the list to the columns in the library.

 

If you need any more information let me know. Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Automated Flow Duplicate List Attachments to a Library

 

Hi @kpiana ,

 

It is difficult to implement if you want to synchronize the attachments contained in the List item to the Library and update the files that exist in the Library when the attachments are updated.

What I think can be achieved is to delete the corresponding file stored in the Library when the attachment is changed, and then re-save the attachment contained in the item to the Library and update the properties.

 

If you think this works, you can refer to the following method to configure Flow.

 

  • Here you need to create a column in the Library to form a correspondence with the List Item. The name of the field is ItemID and the type is Number.
  • Use Get files action to get the file, and use Filter Query to see if the attachments in the item have been synchronized. If not, save the attachment; if there is, delete the file first, then save the attachment again.
  • In the If no branch, the Apply to each 2 action needs to be configured, the remaining actions, you can copy the action inside If yes branch, they are all the same.
  • You only need to delete the Body in Apply to each 3 and then re-select it.

Image reference:

122.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Community Support Team
Community Support Team

Re: Automated Flow Duplicate List Attachments to a Library

 

Hi @kpiana ,

 

It is difficult to implement if you want to synchronize the attachments contained in the List item to the Library and update the files that exist in the Library when the attachments are updated.

What I think can be achieved is to delete the corresponding file stored in the Library when the attachment is changed, and then re-save the attachment contained in the item to the Library and update the properties.

 

If you think this works, you can refer to the following method to configure Flow.

 

  • Here you need to create a column in the Library to form a correspondence with the List Item. The name of the field is ItemID and the type is Number.
  • Use Get files action to get the file, and use Filter Query to see if the attachments in the item have been synchronized. If not, save the attachment; if there is, delete the file first, then save the attachment again.
  • In the If no branch, the Apply to each 2 action needs to be configured, the remaining actions, you can copy the action inside If yes branch, they are all the same.
  • You only need to delete the Body in Apply to each 3 and then re-select it.

Image reference:

122.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

kpiana
Level: Powered On

Re: Automated Flow Duplicate List Attachments to a Library

Hello, and thank you for the response! I have it mostly put together but I am unclear with what you mean by "Here you need to create a column in the Library to form a correspondence with the List Item. The name of the field is ItemID and the type is Number.". Can you clarify this for me?

 

Additionally the 3 important columns that I need the properties copied over from the list and checked is: Last Modified, Last Revised Date(custom column), and Owner(Custom column).

 

 

This is a preview of the List (below)

Capture9.PNG

Community Support Team
Community Support Team

Re: Automated Flow Duplicate List Attachments to a Library

 

Hi @kpiana ,

 

I mean to create an additional relationship by creating an ItemID field in the SharePoint Library where you need to save the attachment to record the ID of the List item where the attachment is located.

 

Because you need to update the attachment, so we need to find the corresponding attachment by ItemID.

 

Hope it makes sense.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
kpiana
Level: Powered On

Re: Automated Flow Duplicate List Attachments to a Library

Great, everything works. Thank you so much for all this help, the instructions where easy to understand and so much help. 

 

Bonus Question... How would I make it so that if a attachment/item from the list is deleted, how can I make it so that it will also delete it from the library. Since right now it will only replicate the actions of Creating and modifying from the list? 

 

Thank you

kpiana
Level: Powered On

Re: Automated Flow Duplicate List Attachments to a Library

@v-bacao-msft 

 

Thanks again for all your help. One additional thing that I would like to know if it is possible to find a work around for... on the files that are created in the Library in this Flow, I have a link for each file that I post on the page site for our company. Now the problem is when ever the attachment is modified in the list and it deletes and creates a new one in the library, it breaks the URL even though the file and itemID is still the same.

 

Is there someway to make it so that the URL will always redirect to the same file that is associated with its unique itemID in the Library. 

 

Let me know if you need further clarification. Thank you!

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (4,619)