I have a flow that triggers when a file is attached to a SharePoint item. The file will then be taken using 'Get attachments' and 'Get attachment content', and a new file will then be created in a specific SharePoint library using 'Create a file'. I have a uniform naming convention to follow so whatever the original name of the file it will always be changed to said format and for multiple attachments, an index that increments is added (ex: This_File, This_File_1, This_File_2...).
The problem occurs, having this scenario as an example - when the process is done and the item is saved but I want to edit or add/attach another file in it, the file will then be renamed to This_File, saving it will overwrite the original This_File that I have in the SharePoint library. Is there any workaround on this? Can I check for the existing files in a library and compare it to the files that are being created?
Does this make sense?
Any help is appreciated.
Solved! Go to Solution.
Hi @RH-MP ,
You could consider creating folders for each item in the specified list, with the ID as the Folder Name.
This way, even if the original file is overwritten, all the Attachments are saved and there is no conflict.
Image reference:
Hope it helps.
Best Regards,
You could use the Get Files (Properties only) action to get a list of the filenames in the folder and then check to see if the Filename you want is included in the collection.
Hi @RH-MP ,
You could consider creating folders for each item in the specified list, with the ID as the Folder Name.
This way, even if the original file is overwritten, all the Attachments are saved and there is no conflict.
Image reference:
Hope it helps.
Best Regards,
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
User | Count |
---|---|
87 | |
57 | |
39 | |
35 | |
33 |
User | Count |
---|---|
79 | |
67 | |
57 | |
49 | |
40 |