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
  • 25 views
  • Translate

kpope
Forum|alt.badge.img+7
  • Apprentice
  • 28 replies

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.

View original
Did this topic help you find an answer to your question?

3 replies

SimonMuntz
Nintex Employee
Forum|alt.badge.img+22
  • Nintex Employee
  • 2461 replies
  • 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.

Translate

MillaZ
Nintex Employee
Forum|alt.badge.img+21
  • Nintex Employee
  • 671 replies
  • March 24, 2025

Hi ​@kpope 
Did you solve your question? 

Translate

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

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

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings