Forum Discussion
Sharepoint Server 2019 double validation (minimum amount of characters or certain character in field
F0RCE Use this formula:
=OR([Field1] = "-", LEN([Field1])>=6)
Note: Sometimes comma(,) does not work in formula (it is based on language or regional settings of your site). So in that case use semicolon(;) instead of comma(,).
Documentation: examples-of-common-formulas-in-lists
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.
- F0RCESep 20, 2022Copper Contributor
It shows that I cannot refer to different column but I am reffering to the same.
Column name is (a survey question):
"II. Programming for IT Business"
Column name in URL at edit page:
"II_x002e__x0020_Programming_x0"
I am using it like that:
=OR([II_x002e__x0020_Programming_x0] = "-";LEN([II_x002e__x0020_Programming_x0])>=6)=OR([II. Programming for IT Business] = "-";LEN([II. Programming for IT Business])>=6)Am I doing something wrong?
When I try to do this from validation menu (not in a question but general menu) it shows that I refer to not existent column....
- ganeshsanapSep 20, 2022MVP
F0RCE I just tried it on my SharePoint site and it works fine for me. Formula used:
=OR([II. Programming for IT Business]="-",LEN([II. Programming for IT Business])>=6)Column settings:
Output:
Try using correct and exact display name of column. Make sure you are using spaces correctly also check case sensitivity (capital/small letters) of column name.
Did you also try using comma instead of semicolon? Or your site works with semicolons only?
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.
- F0RCESep 20, 2022Copper Contributor
This question is a single line of text.
When I am using , it shows syntax error.
When I am using ; it shows that I am reffering to the different column. I check many times, I even renamed field question to 1 and it still showed that I am reffering to different column.
Maybe for my Sharepoint version I also need to refer column in a different way - since I cannot use , maybe I should not use [ ]... I do not know.
trying to see syntax changes between different language versions but cannot find anything
- ganeshsanapSep 20, 2022MVP
F0RCE You have to use the "display name" (name you see in survey) of columns in validation formula and not internal name (name in URL at edit page).
Can you confirm what is the data type (column type) of your question? Is it a "Single line of text" or "Multiple lines of text" or "Choice" column?
If it is a "Multiple lines of text" column, you cannot refer it in general (list) validation settings.
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.