none
SharePoint 2013 - List Validations

    Question

  • Hey Community!

    I am working in SharePoint 2013 and I need to do a multi-conditional list validation, here are the conditions:

        If Checkbox1=true and Input1 Length > 1 then OK,

        OR If Checkbox1= false then OK

        Else Not OK

    Here is my validation code:

       =IF(OR(AND([Checkbox1]=true,LEN(Input1)>1),([Checkbox1]=false)),"OK","Not OK")

    Here is the behavior I am seeing, that regardless of whether the checkbox is checked, an input value provided, or the checkbox is unchecked, the validation error is thrown.

    Does anyone see the problem with the validation?  If so please provide guidance and code examples.

    Thanks!

    Tom


    Tom Molskow - Senior SharePoint Architect - Microsoft Community Contributor 2011 and 2012 Award - Linked-In - SharePoint Gypsy

    Thursday, April 20, 2017 6:13 PM

Answers

  • Did you get my slight edit?  Should read =(OR(AND(Checkbox1=TRUE,LEN(Input1)>1),(Checkbox1=FALSE))).
    • Edited by Ed Thurber Thursday, April 20, 2017 8:39 PM goofed again
    • Marked as answer by Tom Molskow Thursday, April 20, 2017 9:34 PM
    Thursday, April 20, 2017 8:37 PM
  • OK, final code is this:

    =(OR(AND([Checkbox1]=TRUE,LEN(Input1)>1),(AND([Checkbox2]=FALSE,LEN(Input1)<1))))


    Tom Molskow - Senior SharePoint Architect - Microsoft Community Contributor 2011 and 2012 Award - Linked-In - SharePoint Gypsy

    • Marked as answer by Tom Molskow Thursday, April 20, 2017 9:34 PM
    Thursday, April 20, 2017 9:34 PM

All replies

  • Hi Tom.

    Are you referring to Validation or a calculated field?

    When i used this for validation, it worked as you desired:

    =(OR(AND([Checkbox1]=true,LEN(Input1)>1),([Checkbox1]=false)))

    I was only able to save the item when it evaluated to TRUE.

    Ed


    • Edited by Ed Thurber Thursday, April 20, 2017 8:33 PM error in calculation
    Thursday, April 20, 2017 8:23 PM
  • I'm referring to a List Validation - still not working for me.

    Tom Molskow - Senior SharePoint Architect - Microsoft Community Contributor 2011 and 2012 Award - Linked-In - SharePoint Gypsy

    Thursday, April 20, 2017 8:33 PM
  • Did you get my slight edit?  Should read =(OR(AND(Checkbox1=TRUE,LEN(Input1)>1),(Checkbox1=FALSE))).
    • Edited by Ed Thurber Thursday, April 20, 2017 8:39 PM goofed again
    • Marked as answer by Tom Molskow Thursday, April 20, 2017 9:34 PM
    Thursday, April 20, 2017 8:37 PM
  • OK, that does work, problem is I found out I missed a condition:

       Checkbox1=False and Input1<1

    Instead of just

       Checkbox1=False

    Any suggestions?


    Tom Molskow - Senior SharePoint Architect - Microsoft Community Contributor 2011 and 2012 Award - Linked-In - SharePoint Gypsy

    Thursday, April 20, 2017 9:05 PM
  • OK, final code is this:

    =(OR(AND([Checkbox1]=TRUE,LEN(Input1)>1),(AND([Checkbox2]=FALSE,LEN(Input1)<1))))


    Tom Molskow - Senior SharePoint Architect - Microsoft Community Contributor 2011 and 2012 Award - Linked-In - SharePoint Gypsy

    • Marked as answer by Tom Molskow Thursday, April 20, 2017 9:34 PM
    Thursday, April 20, 2017 9:34 PM
  • Hi Tom, 

    Thanks for your sharing. 

    Best Regards, 

    Lisa Chen 


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, April 24, 2017 10:30 AM
    Moderator