I would like to fire off a notification if ( and only if ) someone attaches a file to an existing item. The item may already have attachments from creation, I just need to know if someone ADDS an attachment.
I plan to couple this with Vadim's great tutorial on collecting attachment URLs using a UDA to pipe the actual attachment URLs into this notification....
Not sure how to go about doing this. Perhaps I could use Nintex forms somehow to pass a variable when a file is attached?
Solved! Go to Solution.
unfortunately I don't think it's possible to know if an attachment as just been added..
I think that you have to store in a field of the item some details about the current attachments, so when the item is modified you workflow runs, it checks if the attachments are the same of the ones listed in your field and if yes, it ends otherwise it could do your custom notification logics.
Chaitra, I take it back This doesn't solve my issue because the check for attachments is only True or False, so the conditional start only fires if there were NO attachments previously and now there are. It won't fire if someone adds an additional attachment later.
Chris Almaguer, you can use the GetAttachmentCollection Web service to read the attachments for an item. I would create a field on my list called "Number Attachments" where you can store the number of attachments an item has. Then when an item is modified, you can run a workflow that gets the current collection of attachments, and compares it to the number in that field. If it's different, then you can send your notifications. Here is a workflow that I set up that accomplishes it.
Here is how you setup the Web Service Call. For the List Name use the List Name from Common Properties, and then the ID number for the current Item.
Once you get these Web Service Call results, use a Query XML to extract the attachments and put them in a collection variable. You can then do a count on the collection to determine how many attachments you have.
The very last thing you'll need to do is update the Number of Attachments field so that it matches the current number.