Vynnette26
Rookie

How to count attachments within the nintex form (no workflows)

I am trying to count/sum the total number of attachments in a nintex form. I will use that number to set a field within the form so a workflow is not optimal.

0 Kudos
Reply
1 Reply
allan
Contributor

Re: How to count attachments within the nintex form (no workflows)

What you can do is place this JS code in  the Advanced section of your form settings : 

function GetNumberOfAttachments(attCtrlClassName){
   return NWF.FormFiller.Attachments.GetAttachedFilesCount(NWF.FormFiller.Functions.GetFillerDivObjectForControl(NWF$("#"+NWF$("." + attCtrlClassName + " .nf-attachmentsRow")[0].id)).data('controlid'))
}

 

And add a CSS class on your attachments control, let say "MyAttachmentsControl".

You will then be able to use this function in a rule : 

GetNumberOfAttachments("MyAttachementsControl") < 5 



 

0 Kudos
Reply