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

Insert/Delete attachments in sharepoint list

Hi, I use approvals on a sharepoint list, each entry has only one attachment (a PDF).

I'll perform some operations in my flow once inserted and then rename the attachment applying also a watermak.

To achieve this I'll first get the attachment and then I'll edit several times the SP entry, finally if all went ok I delete the original attachment and the insert a new one with the watermark and with different name.

My doubt is: if I edited several times the SP entry what record ID will you choose to delete the old attachment and insert the new one?

I mean: the original "@triggerOutputs()?['body/ID']" or some of the various updated entries "@outputs('Update_element')?['body/ID']" ?

I ask this beacause only in some situations i found a mess with the attachments saved in SP entry they don't belong to!

Please Help!

Thank you

 

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @bordy12 ,

you should use the ID of the SharePoint item. You'll use it first in the 'Get attachments' action that will provide the attachment(s) id so you can delete them, and then you'll use the same SharePoint item ID to 'Add attachment' to the item.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

1 REPLY 1
tom_riha
Super User
Super User

Hello @bordy12 ,

you should use the ID of the SharePoint item. You'll use it first in the 'Get attachments' action that will provide the attachment(s) id so you can delete them, and then you'll use the same SharePoint item ID to 'Add attachment' to the item.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (5,792)