How to perform list validation using if statement?
-
29-01-2021 - |
Domanda
If column [Status] = 'Approved' then [Run Date] must be >= today()
I cannot seem to get the syntax for this validation correct. Can anyone help out?
I understand the validation has to return true.
Soluzione
I think you should take a look at the validation functions for SharePoint. It's very similar to Excel.
A reference for Validation expressions
A couple things to keep in mind:
- Validation equations must return
True
orFalse
- Column validations can't refer to other columns (in this case you'll need to do a List validation, not column validation)
So we'll need some sort of boolean statements returned... I'll assume your statement is to return True
if [Status] not equal to "Approved"
Try something like the following:
if( [Status]="Approved", [Run Date]>=Today(), True )
Altri suggerimenti
Assuming that you are looking for list validation formula, the formula would look like below. Here is a support article from Microsoft on formulas
=IF(Status="Approved",IF(RunDate>=TODAY(),1,0),0)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange