AnsweredAssumed Answered

Attachments required on Condition in repeating section

Question asked by cmikhaiel on Jul 10, 2018
Latest reply on Jul 23, 2018 by rhia

Now that we have the new feature available: Allow attachments control in the repeating sections. I want to be able to make the attachment required on condition. 

I've asked that question before when it was a standalone/single attachment field within the form. and we have a solution for that recorded here: Make attachments required on condition 


But the same solution doesn't work when the attachment control is placed within a repeating section. 

It doesn't validate. The rule is only checking if a field (that is outside the repeating section) of type "Yes/no" that is  == "Yes" then I want to make all the attachments within the repeating sections require at least 1 attachment.


I tried to put an additional rule, where a value within the repeating section is not blank, then make the attachment required (check if the attachment count is greater than 0). It doesn't fire either. 

Here is the validation rule:

Nintex Forms Designer - IPMA - Prototype 0.7 - Item

GetNumberOfAttachments("attCtrlClassName2") < 1 && (Tabs == "1") && equals(nQ1_EnrolledOther YN, "Yes") && not(isNullOrEmpty(nQ1_1_ProfessionalLicensingBody))
where nQ1_1_ProfessionalLicensingBody field is a drop down menu within the repeating section - defaulted to be blank. 
the "tabs" is just a radio button outside the repeating section and that's the named control. 
the "nQ1_Enrolles_YN" is the Yes/No field selected outside the repeating section and is defaulted to blank.

The Javascript to to count the attachments is this: 

Formatta Replacement - DEV

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


Emphasizing: This all works when there is one more attachment control but not placed within a repeating section. 

Once it is placed into the repeating section, it doesn't fire anymore. 


Do I need to add any additional validations or checks if it is placed in a repeating section? 


Any thoughts?