Field Level Validation - Require Non-blanks on Numerical Fields
-
08-02-2021 - |
Pregunta
I have a custom SP list with a handful of non-required numerical fields. I'd like to write a column validation rule for each that would force users to enter any value >=0. Our users will be using Data Sheet View only and editing existing records, not creating new ones (so no Infopath or form solutions).
The rule I've tried is =[Target Field]>=0
This doesn't work because SP treats blanks as 0's. Users could simply skip this field and SP would still see it as "0" therefore passing validation.
Rules
- Users should only be able to enter "0", or any other integer. They cannot leave the column blank.
- Users are only editing existing records in datasheet view. Not creating new ones. Thus, making a field required will not work
Solución
- Try using below formula (This will ensure the entered value is greater than 0):
=[Target Field]<>0
Else, if you want to force your users add any integer including 0 in your numeric field then you need to make your field Required.
Also you can set the default value of your column to 0 if user does not add any value in the column while creating a new item.