Forum Discussion
SharePoint Column Validation
Hello SP community,
I want to validate that the users select either "Pre", or "Post" choice if they selected Yes to a previous column.
I've created two a choice column, one is a Yes/No choice, and the other is "Pre" or "Post". When a user selects "Yes" in the first column I want to validate that they also select either "Pre", or "Post" in the following column. If they selected No, then they aren't required to select "Pre" or "Post".
I am not sure if this is possible or maybe there is another solution rather than using column validation? I was thinking a calculated column, but they have two choices after selecting "Yes".
Thank you!
Note: You have to add this formula in List validation settings and not column validation settings.
Follow below steps:
- Go to SharePoint list
- Click on Settings icon and select List settings
- Select Validation settings
- Add formula & user message and click Save
Reference: List validation if then syntax
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
10 Replies
Note: You have to add this formula in List validation settings and not column validation settings.
Follow below steps:
- Go to SharePoint list
- Click on Settings icon and select List settings
- Select Validation settings
- Add formula & user message and click Save
Reference: List validation if then syntax
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- jobon4eCopper Contributor
@ganeshsanap , may I also ask you to support my intent to improve my SP list? I have a drop-down list with 4 options, one of them is "Acceptance". Another column has the following values: "low", "medium", "high".
I would like to apply the validation so that if in the 1 column, we have the "low" value, in the 2nd we have automatically populated the "Acceptance" option. In all other cases for "medium" and "high," we should be able to select from the drop-down options, including "Acceptance".
Do you think that this is possible at all?
Thank you in advance for your response.
- jobon4eCopper Contributor
ganeshsanap , may I also ask you to support my intent to improve my SP list? I have a drop-down list with 4 options, one of them is "Acceptance". Another column has the following values: "low", "medium", "high".
I would like to apply the validation so that if in the 1 column, we have the "low" value, in the 2nd we have automatically populated the "Acceptance" option. In all other cases for "medium" and "high," we should be able to select from the drop-down options, including "Acceptance".
Do you think that this is possible at all?
Thank you in advance for your responce.
- Melow28Copper Contributor
ganeshsanap hello can you also help me, the column is budget needed? Yes/No, if user select yes the they need to input the budget amount in the column Value.
I tried this formula but I’m having error
=IF(Budget Needed="Yes",IF([Value]<>"",TRUE,FALSE),TRUE)
Melow28 Is your "Budget Needed" of column type "Choice" or "Yes/No" (Boolean)?
Try using formula like:
=IF([Budget Needed]="Yes",IF(ISBLANK([Value]),FALSE,TRUE),TRUE)
Make sure to use the correct display names of your list columns in formula. Also, check above responses/Notes for more understanding.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
SXT3410 This is possible using List validation settings. You can use formula like:
=IF([Column 1] = "Yes", OR([Column 2] = "Pre", [Column 2] = "Post"), TRUE)
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- MiriamGmsAnswerCopper Contributor
ganeshsanap I tried this code, but I got an error when I tried
=IF(RequiresPreparation="Yes",OR(TaskType="Pre",TaskType="Post"),FALSE)
It ran perfect
- SXT3410Copper Contributor
I tested the formula, and it works as intended! Thank you also for the note ganeshsanap, I wasn't aware of the validation setting.