Skip to main content
Nintex Community Menu Bar

For SP/Nintex 2016 on prem, in a form, what is the rule formula to ensure attachments are added IF a certain field (which is named and inside a panel) is not null.  In other words, If the user enters data into a field (single line of text), Attachments are required.  Otherwise Attachments are not required. 

 

I created a rule on the SUBMIT button to Invalidate with the following formula but it’s not working as desired.

and(not(isNullOrEmpty({namedControl})), isNullOrEmpty({ItemProperty:Attachments})

Hi ​@kpope,

The issue with your rule is that you are using {ItemProperty:Attachments}. This looks at the attachments on the SharePoint item when the form is in edit mode and not the attachments on the attachment form control.
The only out-of-the-box validation for the Attachment control is in the control's configuration, but it is limited to the number of required attachments. The link below shows how you can make the attachment control require one attachment and then hide it. While the attachment control is hidden, the validation will not trigger. You can then configure a rule that unhides the attachment control when the NamedControl is not empty.
 


The only alternative is to use Javascript to do the validation.


Hi ​@kpope 
Did you solve your question? 


I applied this technique and it works without error, thank you. 


Reply