Announcements
The problem I am having is when I add an attachment with a file name that already exists in the "documents" folder the flow fails. Each attachment is tied to a specific panel using a Panel ID, some panels will have the same files attached causing duplicates. Is there a way that either I can allow duplicates in the library or append a unique Id to the end of the file?
I am also looking for advice on deleting files from the library when the attachment is removed?
Hi @PowerAppsUser97 ,
If I understand correctly: you use a Flow to upload a document to a library ?
You could use something like:
concat(PanelID,YourFileName)
in the filename box, to create a unique filename.
Hope this helps,
Marc
Hi, Thank you for your response. I had tried this solution but it creates a new problem where the file name of the attachment (FileName) is different to the one thats is stored in documents (PanelID_FileName). Is there a simple action that renames an attachment or is deleting the attachment and reading it the only way?
Could you explain a bit more:
-the file you want to attach: is it a file in a SharePoint documents folder?
-the attachment: is it stored in a different folder or attached to an item in a List?
In Flow there is a SharePoint move action that has an option 'If another file is already there' and then you can choose 'Move with a new name' but that gives an error on my side.
Hi,
The file i want to attach is stored locally on the users machine. I want this file to attach to an item in a sharepoint list. When this is attached it then creates this file in the documents folder.
The solution above works for the creation of the file but the attachment in the list is not updated to the new name of the file. Move file is another solution that works but the naming of the file issue still exists.
I think deleting the original attachment and attaching the new file to the item is indeed a good way, since you have them already available in your flow.
There's also this post you might already have seen: Solved: How to rename SharePoint list attachment file name... - Power Platform Community (microsoft.com)
You could also reference the documents in the folder instead of attaching them, if they are not altered by the user of course.
@PowerAppsUser97, I usually add UTCNow() to the name of the files.
Regards,AhmedIf my reply helped you, please give a 👍. And if it has solved your issue, please consider a 👍 & Accepting it as the Solution to help other members of the community find it more
My Blog: www.powerplatformplace.com
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 354 Super User 2026 Season 2
M Bilal Khan 320
Mohsin Ali 246