I have a workflow that occasionally fails because, according to the NWC error message, "A file attachment with name '[File name].pdf' already exists" (in the SharePoint list where instance data is being written from NWC). This is in a workflow where users submit requests to pay vendors. One thing they can do on the form, and they often do, is attach some kind of documentation (such as an invoice). The documentation is attached to the item in a SharePoint list.
Â
We've had a couple of instances where the user attached a file with the same name as a file they had attached in a previous instance, such as "Invoice - John Smith.pdf," and the workflow failed due to the above reason. This is happening even though the attachments are in different items in the list.
Â
So I guess what I want to do is search the SharePoint list and identify any attachments anywhere in the list that have the same filename as the attachment in the current NWC instance, and if there are any, rename one of the documents so that the filenames are no longer identical. Not sure how to do this.
Â
I know we have the NWC actions that work with files/attachments in SharePoint but I'm not sure how (or if) to use them for something like this. Any help would be appreciated.