1

For some unknown reason whenever I upload a new document to the document library, my background flow pulls the required data correctly but it creates multiple new items when it's only meant to create one in the list.

It seems to create as many new items in the list as there are files in the SharePoint library.

Can anyone see what I'm doing wrong.

Screenshots below.

enter image description here

enter image description here

enter image description here

enter image description here

1 Answer 1

0

You are using Get files (properties only) action which retrieves all files in mentioned library/folder. Then you are applying loop on all results/files >> This is the reason flow is creating multiple items for each file in folder/library.


If you are trying to get the properties of newly uploaded file, you should directly use "List rows present in a table" action in Power Automate like:

enter image description here

You need to pass the file Identifier from trigger to this action to limit the file.

7
  • Ok, thanks for the reply. So I should remove the "Get files (properties only)" item in the flow? I configured 'varIdentifier' to encourage dynamic file name recognition. Can I still use that in "list rows..." for the file? Or does it have to be SharePoint 'Identifier'? Commented Nov 3, 2021 at 12:50
  • First of all, are you trying to get the rows from only one file (for which flow is running), right? If Yes, you can remove "Get files" action. Commented Nov 3, 2021 at 12:55
  • Yes, I am trying to get the rows from one table in an excel file. This flow is triggered every time a new file is uploaded. Commented Nov 3, 2021 at 12:56
  • No need to create new variable for passing file name dynamically to "List rows present in a table" action. You can directly use Identifier from trigger outputs which is also dynamic file identifier for the particular file. see image attached in my answer. Also, in this case you don't have to use first "Apply to each" loop in your flow as now you only have one file. Commented Nov 3, 2021 at 12:57
  • Thanks for the replies. I made the changes you suggested, however the flow does not work now. New items aren't being created. Also, flow is automatically creating "Apply to each" items. I can't seem to stop this. Commented Nov 3, 2021 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.