Column validation for a People picker RRS feed

  • Question

  • I have a list with several columns, one is a "Client Letter" (Choice - Yes/No) and "Signatory" (People picker) that I want do some validation on if possible.

    Since there is no validation on the People picker I though there may be a way to use validation on the Choice column as these 2 are related as follows.

    If the choice is Yes, then the people picker must not be NUL. If the choice is no then the people picker can be NUL.

    I tried a formula on the choice but not sure if this is possilbe or just the wrong syntax as its not working.

    =IF([Client Letter]="Yes",[Signatory]<>"")

    Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties.

    Thursday, May 3, 2012 6:06 PM

All replies

  • You need to modify the AddItem form of the list in SharePoint designer and put a custom validator in on your people picker to check the Choice column. For more reference check : http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/7ea35995-b907-48a4-8a44-cfbd7b549b2b/ 

    Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

    Thursday, May 3, 2012 8:26 PM
  • get2pallav, thanks for the reply. I haven't had a chance to look at this but will try it this week.

    Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties.

    Monday, May 7, 2012 2:39 PM
  • Your validation must return true or false, so I think you're missing the part where you don't need the signatory. This is going to have to be a validation at the list level since you're comparing 2 fields.

    If client letter is yes, you test the value of signatory, otherwise you just return true because you won't care.

    =if([Client Letter]="Yes",[Signatory]<> "", true)

    Depending on the Client Letter column, you might test with Yes, or true, or 1, I can never remember which is used when.


    Monday, May 7, 2012 10:40 PM
  • Thanks Robin for the reply.

    I tried your formula but I get the error "One or more column references are not allowed, because the columns are defined as a data type that is not supported in formulas."

    I Googled this and it looks like the [Signatory] which is a People picker can't be used in validation. This would explain by this column type doesn't have a validation option itself like other columns do.

    Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties.

    • Edited by Stunpals Tuesday, May 8, 2012 2:43 PM
    Tuesday, May 8, 2012 2:42 PM
  • If you are using InfoPath, then here is the solution.

    Create a hidden field(say, temp) with boolean type(Yes/No). Create rule on the choice field like:

    If choice="Choice1" then set a field value temp="yes"

    If choice="Choice2" then set a field value temp="no"

    next, create a validation rule on the temp field with condition as 

    "If Choice='Choice1' and Peoplepickerfield is blank" , enter the screen tip as "People Picker cannot be empty".

    That's it!

    Friday, May 6, 2016 4:00 PM
  • Thanks Sathiya, but this is not a InfoPath form and I am not able to change it at this point.

    Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties.

    Friday, May 6, 2016 4:15 PM