Forum Discussion
SharePoint Column Validation needs an upgrade
Hi,
Is there any plan to update the column validation part of columns within any version of SharePoint. This is starting to feel very old and outdated.
Seriously, doing something as simple a checking if this: "001.123.456.789" is valid is VERY hard for no reason at all. As soon as there is a need for a little flexibility in the validation, this is a nightmare.
Why in 2021 is there not a simple Regex validation that can be done? I'm pretty sure 99% of the validation could be done using Regex here.
But no, we're stuck with 1990 excel style formula that haven't been updated in forever. At least, if we're stuck with these.... why the hell does it not support ALL OF THEM?! Where is Substitute? Where is IFERROR? Why can't we use array({1,2,3,4,5,6,7,8} for example) in something like MID?
This is so restrictive that if I want the above string to be validated if it contains only digits between the dots, I would normally do a substitute for all "." and then put that in VALUE and check for ISNUMBER. That way, if everything without the . amounts to a real number, they're all digits and not other characters.
No. Here we need to do Search for ".", then use the position to do a MID and then do the same for every single part between ".". And since we don't know how many "." there is in the string, we have to account for errors. using IFERROR is impossible so gotta use IF with ISERR to do that. but when doing that, you end up doubling the amount of characters used in the formula (Since you need to verify the value for error with ISERR, and if it's error free, write it again to get the value, otherwise, write nothing).
In the need, to validate just 4 set of characters for digits like above, you approach 2000 characters formula that are all embebded into each other and is totally unreadable. And cherry on the cake, Sharepoint only allow 1024 characters for validation.... So all that for nothing.
When... You know, checking for all that in a REGEX would be "[0-9.]*".
But that's way to simple I guess to implement.
1 Reply
- drizztdourden_Copper ContributorJust to show how stupid this can be. This is the version WITHOUT IF(ISERR()) since I was already busting the characters count at this point.
=ISNUMBER(VALUE(CONCAT(MID(A2,1, IFERROR(SEARCH(".",A2,1),LEN(A2)+1)-1),MID(A2,IFERROR(SEARCH(".",A2,1),LEN(A2)+1)+1,IFERROR(SEARCH(".",A2,IFERROR(SEARCH(".",A2,1),LEN(A2)+1)+1),LEN(A2)+1)-IFERROR(SEARCH(".",A2,1),LEN(A2)+1)-1),MID(A2,IFERROR(SEARCH(".",A2,IFERROR(SEARCH(".",A2,1),LEN(A2)+1)+1),LEN(A2)+1)+1,IFERROR(SEARCH(".",A2,IFERROR(SEARCH(".",A2,IFERROR(SEARCH(".",A2,1),LEN(A2)+1)+1),LEN(A2)+1)+1),LEN(A2)+1)-IFERROR(SEARCH(".",A2,IFERROR(SEARCH(".",A2,1),LEN(A2)+1)+1),LEN(A2)+1)-1),MID(A2,IFERROR(SEARCH(".",A2,IFERROR(SEARCH(".",A2,IFERROR(SEARCH(".",A2,1),LEN(A2)+1)+1),LEN(A2)+1)+1),LEN(A2)+1)+1,IFERROR(SEARCH(".",A2,IFERROR(SEARCH(".",A2,IFERROR(SEARCH(".",A2,IFERROR(SEARCH(".",A2,1),LEN(A2)+1)+1),LEN(A2)+1)+1),LEN(A2)+1)+1),LEN(A2)+1)-IFERROR(SEARCH(".",A2,IFERROR(SEARCH(".",A2,IFERROR(SEARCH(".",A2,1),LEN(A2)+1)+1),LEN(A2)+1)+1),LEN(A2)+1)-1))))
Imagine if you have to repeat the whole SEARCH() everytime there is a IFERROR in this formula. This become even more insane than it already is. That's without counting the fact that every "A2" in my formula above needs to be the column name in Sharepoint [xxxxxxx]. So even more characters count.
If we had substitute, it would look like this: =ISNUMBER(VALUE(SUBSTITUTE(A2,".","")))
Insane how one simple addition (And something that's casually available in any language out there) can reduce the complexity by that much.