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

  • 14 December 2021
  • 2 replies
  • 243 views

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.


2 replies

Userlevel 4
Badge +9

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




 

Userlevel 1
Badge +4

Unfortunately, this suggestion does not work for the new responsive designer for Nintex Forms for SharePoint Online. There's no way to embed custom JS code on the form.

Reply