I would like to trigger a rule if someone ADDS a file to a list item. The Attachment field is Boolean and only checks if there is something there, not if something is new. So I thought maybe you could count the number of attachments and then compare for change to trigger a rule in DFFS or a workflow.
I checked the web and there wasn’t much that gave me hope. I did find one site that put the output to a cvs file, but it is not DFFS friendly. https://easysp.wordpress.com/2016/06/02/finding-number-of-attachments-items-wise-in-a-sharepoint-list/
However I did notice they were using item.AttachmentFiles.Count so I tinkered with the code below, but I keep getting various errors depending on how I have it configured.
I either get an undefined error or a function expected error. I tried it with a function name called by a rule and still no dice.
I tried it like this
var IAFC = spjs.dffs(item.AttachmentFiles.Count)
and
var IAFC = (item.AttachmentFiles.Count)
and all versions in between. Even tried AttachmentId
{
var IAFC = spjs.dffs(item.AttachmentFiles.Count);
var AFC = spjs.dffs("Attachment_Files_Count");
var NAFC = Math.floor(IAFC + AFC);
setFieldValue("Attachment_Files_Count",NAFC);
}`
Thoughts? Suggestions?