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

AFernandez 21 Reputation points
2021-08-20T16:01:08.383+00:00

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,

Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

Accepted answer
  1. Allen Xu_MSFT 13,861 Reputation points
    2021-08-23T07:10:37.683+00:00

    Hi @AFernandez ,

    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.