How to include multiple AND/OR conditions in validation settings for SPO list?

Allison B 1 Reputation point
2022-12-29T21:09:17.907+00:00

I'm trying to make specific fields required based on the selection within other fields.

Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

2 answers

Sort by: Most helpful
  1. Allison B 1 Reputation point
    2024-01-04T16:06:14.25+00:00

    Hi @Xuyan Ding - MSFT - the complexity that I am looking for with this formula has greatly increased, so I have a follow up question.

    Here is what I am trying to accomplish:

    1. Within a SPO list form, there is an "issue type" choice column with multiple selections.
    2. Depending on which issue type is selected, a variety of other columns should be required.
    3. For example, IF issue type = Product Packaging Issue, then Image of Item, Lot Code, and Expiration Date would be required. BUT if issue type = Out-of-Stock Inquiry, then Brand and UPC would be required.
    4. There are more variations than that, but here is the formula I attempted, but am getting a syntax error:

    =IF(OR(OR([Issue Type: Grocery]=”Out-of-Stock Inquiry”,[Issue Type: Whole Body]=”Out-of-Stock Inquiry”),IF(AND([Brand]<>””,[UPCs or PLUs]<>””),TRUE,FALSE),TRUE),IF(OR([Issue Type: Grocery]=”Packaging & Supply Order Issues”,[Issue Type: Grocery]=”Product Packaging Issues”,[Issue Type: Whole Body]=”Packaging & Supply Order Issues”,[Issue Type: Whole Body]=”Product Packaging Issues”),IF(AND([Image of Item]<>””,[Lot Code]<>””,[Expiration Date]<>””),TRUE,FALSE),TRUE))

    0 comments No comments

  2. Xuyan Ding - MSFT 7,601 Reputation points
    2022-12-30T10:08:06.957+00:00

    Hi @Allison B ,

    Let me give you an example. If the value of column A is Yes, then column B should be required.
    The formula should be: IF([A]=TRUE,IF([B]="",FALSE,TRUE),TRUE)
    275092-image.png 274978-image.png

    ====================
    Update
    If there are three fields, B is required when A is selected, and B is not required when C is selected.
    The formula should be: IF(OR(A=TRUE,C=FALSE),IF(B="",FALSE,TRUE),TRUE)


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.