question

AFernandez-6445 avatar image
0 Votes"
AFernandez-6445 asked AllenXu-MSFT answered

How to delete attachments from a SharePoint online list using Power Automate

Hi,

I am new to power automate and following examples I found on the internet I created my first flow. The flow sends attachments added to a SharePoint list via a PowerApp application to a SharePoint document library. The problem is that the way the flow is set at this moment, attachments remain in the SharePoint list after they have been sent to the library, creating duplication of data.

I have tried adding an additional step to the flow using information I found on the internet, but no matter what I try I get the warning Actions in this flow may result in an infinite trigger loop. Please ensure you add appropriate conditional checks to prevent this flow from triggering itself.

Right now, I have the end users manually deleting the attachments from the list after they have been sent to the SharePoint document library, but this is not practical in my scenario. I want to add an additional step to the flow that automatically delete attachments in the SharePoint list after they have been sent to the SharePoint document library.

Attached are the images of how the flow is set up:

125038-1stpartofflow.jpg

125131-2ndpartofflow.jpg

125123-3rdpartofflow.jpg

Thank you very much for the help!

Ariel,


office-sharepoint-online
1stpartofflow.jpg (53.7 KiB)
2ndpartofflow.jpg (60.1 KiB)
3rdpartofflow.jpg (53.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AllenXu-MSFT avatar image
0 Votes"
AllenXu-MSFT answered

Hi @AFernandez-6445 ,

I added a Delete attachment action and saved the flow. I got the same warning as yours.
125477-image.png

This is becuase after the flow deletes the attachment of the list item, at the same time the list item is modified. And as soon as the list item is modified, the flow will be triggered again since the trigger of the flow is "When an item is created or modified". So you got the infinite trigger loop warning.

As per my test, the flow can be exectued successfully and this warning didn't affect the flow to delete attachements after uploading the attachment to the library. It is just a warning and not an error. You can ignore this warning since it doesn't cause any negative impact on your requirement.


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


image.png (26.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.