Custom Validtion syntax for the IN operator for a column of SharePoint list
-
08-02-2021 - |
Question
I am trying to find out how can I write a code to restrict a user to enter a value among a set of predefined values (i.e. IN Operator) in a column of a SharePoint list.
My column name is "Asset type" and I have tried these (below) based on this in the Formula section.
[Asset type] in ("Innovation","Communication")
[Asset type]= [Asset type] in ("Innovation","Communication")
[Asset type]= if([Asset type] in ("Innovation","Communication"), TRUE, FALSE)
[Asset type]= AND(if([Asset type] in ("Innovation"), "Innovation", "Wrong value"), "Similar condition for communication")
[Asset type]= AND(if([Asset type] in ("Innovation"), "Innovation", FALSE), "Similar condition for communication")
And the error I am getting is:
Sorry, something went wrong
The formula contains a syntax error or is not supported.
Solution
You could use OR function in the column validation. Example:
=OR([Asset type]="Innovation",[Asset type]="Communication")
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange