Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Attachments required on Condition in repeating section

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? 

0 Kudos
2 Replies
Workflow Hero

Re: Attachments required on Condition in repeating section

To add: 

I also tried to remove the Javascript and basically have this rule only: where if there is a record added in the repeating section then the minumim attachment on each record is "1". 

And that's not working either. It doesn't fire. 

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Attachments required on Condition in repeating section

Hi Christine - 

I asked Marian Hatala‌ about this and they said that the JavaScript would not work. I trust Marian.

I've posted this in User Voice - Get Attachment Count – Customer Feedback for Nintex   -- of course that doesn't help now....


0 Kudos
Accept as Solution Reply