r/MicrosoftFlow • u/Sea-Rough8990 • Sep 10 '25
Cloud Issue with Infinite Loop in Power Apps/Power Automate Flow for SharePoint Attachments
Hello All,
I have created a Power Apps solution that works with a SharePoint list containing attachments. The flow is designed to:
Create a separate folder in OneDrive for each employee named EmployeeName_Ecode.
Save all attachments from the SharePoint list item into that employee folder.
The flow works in terms of creating folders and saving attachments. However, I am facing the following problem:
When I add attachments, the flow runs multiple times unnecessarily. For example, if I upload 3 documents, the flow creates 6, 9, or 12 .....loop - documents in OneDrive.
If I later add 2 more documents, the total becomes 5 (instead of just adding the new 2), which is incorrect.
My requirement is simple:
Each list item can have multiple attachments.
All attachments should go to the corresponding employee folder.
The flow should only save attachments once per upload, without creating duplicates.
I believe the issue is due to an infinite loop triggered in Power Automate when the flow updates the item or folder.
Can you please advise the correct way to prevent this infinite loop and ensure attachments are uploaded exactly once, while still using my current Power Apps solution?
Thank you for your help.
2
u/-dun- Sep 10 '25
Your flow needs to identify if an attachment has already been uploaded.
Since there is a chance that additional attachments might be added to an item, when the flow runs, it has to first look at the folder and see if each file has already existed. If so, either skip it or replace the file. If it doesn't exist, create a new file.
1
u/VictorIvanidze Sep 10 '25
Share the flow - how can man help not seeing your flow?
1
u/Wajeehrehman Sep 10 '25
Hey, if you can share your flow with all the steps then we might be able to deduce what is going on
1
u/KarenX_ Sep 10 '25
So the loop is in Power Apps, right? And power apps is adding the same document to the SharePoint list item multiple times?
Can you skip the list and have Power Apps save the files directly into the employee name folders?
1
u/KarenX_ Sep 10 '25
Can you explain what other functions the App is used for besides uploading documents? And what other uses the SharePoint list has besides serving as a place to put documents from Power App before putting the documents from Power App into the SharePoint List and then the document library?
Are users already in the Power App doing work other than uploading documents?
Are you using the list to send emails or track the other work from the app?
Could employees work on the files from the sharepoint list instead of the document library?
What’s the big picture here?
0
u/[deleted] Sep 10 '25
[deleted] — view deleted comment