Skip to main content
Nintex Community Menu Bar
Solved

Nintex On Prem - Rule needed to validate if a field is not null, Attachments are required

  • March 19, 2025
  • 3 replies
  • 74 views

kpope
Forum|alt.badge.img+7

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})

Best answer by SimonMuntz

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.

3 replies

SimonMuntz
Nintex Employee
Forum|alt.badge.img+23
  • Nintex Employee
  • Answer
  • March 19, 2025

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.


MillaZ
Nintex Employee
Forum|alt.badge.img+22
  • Nintex Employee
  • March 24, 2025

Hi ​@kpope 
Did you solve your question? 


kpope
Forum|alt.badge.img+7
  • Author
  • Apprentice
  • March 25, 2025

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