Solved

Validation Rule on 'people' control when a choice control is a specific value

  • 23 October 2019
  • 4 replies
  • 36 views

Badge +4

This has me stuck for 3 hours now... I'm missing something!

Using "old" responsive form builder, SharePoint Online.

I have a mandatory choice field named "Type" - two choices: "Field" and "Inside".

When "Inside" is picked the initiator must fill in a name on a "people" field called "Director".  Because that field is not needed if "Field" is chosen, I couldn't make it mandatory in SharePoint.

I'm looking to build a validation rule on the "Director" box that stops the form from submitting if "Type=Inside" and "Director" is null/void.

 

Please, someone come to my rescue!

icon

Best answer by SimonMuntz 24 October 2019, 01:51

View original

4 replies

Userlevel 6
Badge +22

Hi,


 


The following rule will do the job when added to the People Picker control.


and(equals(Choice, "Inside"),isNullOrEmpty({Self}))


Sample Responsive form attached.

You may need to add "isNullOrEmpty(Director)" as wel.


equals(Choice, "Inside")||isNullOrEmpty(Director)


set it on th people picker control.


 

Badge +4

UGH, really?!  Yep, this was the answer.  Why I didn't just use a rule in the first place instead of going into the People control and doing a 'validation' I'll never know... Don't you hate it when you are SO close and just can't get the rest of the way there!


 


Thank you!  It may be only 7:40 AM EST, but you have made my whole day!

Userlevel 6
Badge +22
Unfortunatley you cannot reference another control from inside the the configuration of a controls's validation section so a rule needs to be used.

Reply