Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Solution
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

Update SharePoint item attachment with Power Automate

Posted on December 8, 2021December 12, 2021 by Tom

“I use Power Automate to synchronise two SharePoint lists, but I don’t know how to update the item attachment, what’s the best approach?”


Very often when you synchronise two SP lists, it’s enough to synchronise the columns. With every change in one of the columns you’ll do the same change in the second list. But what about item attachments? If users update the attachment, how can you update it also in the second item?

Where is the attachment stored

If you check the output of the ‘Get attachments’ action, you’ll see the location of the attachment. All the attachments are stored directly in the list in hidden folders. It’s the folder /Attachments/, followed by the /item id/ and the actual /file name/.

It’s a bit different from other files as even though you’ve got the url, you can’t open it in browser. But you can process the attachments as any other file, if you know its identifier.

Don’t try to update the attachment

While it might be tempting to try to update the attachment, similar to updating any other file in SharePoint, I don’t think it’s worth it. Unlike the updates in columns, it’s not possible to recognise if there was any change in the attachments. Flow to update the attachments would have to check if given attachment exists, and create or update it later. It would have to process all of them.

Replace the attachment

Since all the attachments are stored in a hidden folder in the SharePoint list, they don’t support the standard document features. They don’t move to the recycle bin after deletion, nor are they keeping versions. Attachments either exist or they don’t. Therefore, if you decide to save some work, you can just delete all the existing attachments and upload them again. You won’t lose any functionality nor save API calls.

Power Automate update item attachment

You also don’t have to check if the attachment exists, or connect the attachments if there’s more of them. Just do a full cleanup and re-upload.

Summary

As you can see, the best approach to update item attachment in Power Automate is to actually replace them. No checking if the attachment exists nor connecting with an existing one. A simple upload and delete will do the trick.


πŸš€ Master Power Automate

Join 2,100+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

11 thoughts on “Update SharePoint item attachment with Power Automate”

  1. George says:
    June 18, 2022 at 10:18 pm

    Thanks for the tips, this is quite helpful. Is there an option to update the attachment field. Assuming I have a document that has been updated (approved) in a document library, but the list item attachment column of another SharePoint list already holds a picture file and I just want to amend the list item attachment to include the updated updated file if a condition is met?

    Reply
    1. Tom says:
      June 22, 2022 at 9:21 pm

      Hello George,
      if it’s only about adding a new attachment to a SP item then you can do that, just get the file content and add it as a new attachment to the item, the existing attachments will stay intact.

      Reply
  2. Chad says:
    December 6, 2022 at 12:19 am

    This is great if you know the list. However, if the list itself is dynamic, how can you add an attachment? I’m already creating the list item through an HTTP call, but can’t figure out how to add the attachment to the new list item.

    Reply
    1. Chad says:
      December 6, 2022 at 6:52 pm

      Got it! I used “Add Attachment” and was able to get the ID of the new list item from the previous action to create the item. Thankfully, the list always has the same name, the site is just different.

      Reply
  3. Melissa says:
    September 28, 2023 at 10:14 am

    Hello!

    Thanks for this post, could you please show how to upload attachments to existing sharepoint list items. In order to match correct pdf to correct item this should be done with the same name on the list item and attachment.

    I have for example 50 pdf files all with a certain unique name. I have also 50 sharepoint list items with the same names. Now I want to update the sharepoint list items with the corresponding pdfs as attachments to the list items in one go.

    I really appreciate if you could showcase this example.

    BR
    Melissa

    Reply
    1. Tom says:
      October 22, 2023 at 3:51 pm

      Hello Melissa,
      list all the items in the list, for each item find the corresponding file using the file name: https://tomriha.com/power-automate-to-filter-file-in-sharepoint-by-file-name/, and update it. Get items -> Apply to each (output from Get items) -> Get files (properties only) with the filter by file name -> Add file attachment

      Reply
      1. Dean B says:
        November 27, 2024 at 1:24 am

        Hi, Tom is there a more detailed way of these steps? I’m encountering the same problem where when a new file is created from a Plumsail FORM, the PDF needs to be added as an attachment to the items in a SP list. the common name of both the SP list item and file name I’m attaching is the Company Name so I can use this to find which Item in the SP list it needs to be attached to. The company names are unique values so no repetition will happen.
        ex: List Item Name= XYZ company then Filename=XYZ Company.pdf.

        Reply
  4. Steve H says:
    May 15, 2025 at 1:43 am

    I am missing a crucial step or idea here. What is the difference between get attachments item a and get attachments item B? You delete item B and add item a attachments? What is the difference. Please explain in a bit better detail so us newbies to PA can understand.

    Reply
    1. Tom says:
      May 17, 2025 at 12:54 pm

      Hello Steve,
      attachments item A are from the original item, attachments item B are from the second item. You delete all attachments in the second item (B) and replace them with attachments from the original item (A)

      Reply
      1. Steve says:
        May 19, 2025 at 9:06 pm

        But it is the same Get Item ID in both A & B – so mine throws an error saying the attachments are deleted when I try to add them again?

        Reply
      2. Steve says:
        May 19, 2025 at 9:11 pm

        When you say second item what exactly are you referring to? I am only getting one item in my trigger and the get item action is getting the ID from the item when it is modified or created….what other item(s) are we talking about? Very confused,

        Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

πŸš€ Master Power Automate

Join 2,100+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Still exchanging emails to get things approved?

Get the Approval Process solution to skip the hard part and deploy an automated, fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Are your approvals stuck due to unavailable approvers?

Keep your approvals running with the Approval task delegation app! Reassign any existing approval task to another user with a single click - no more waiting for absent approvers!

Power Automate approval task delegation ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes