On my SharePoint online site I have a custom list with a Number field.I want to apply validation on this field so that the Number should not be less than or greater than 5 digits and it should be without commas and any wild characters.
You can use input mask on that number field.
Below is the script:
For your requirement, you can replace with below line:
Here is similar thread: Column validation for US phone number format
Reference: Input mask on textbox
Expanding on @Naveen's answer, for making the user only enter 5 digits you can enter this formula in column validation:
=AND(Column>10000,Column<99999). You can then enter a custom message for that. Replace
Column with your column name. As for the 2nd part of your question, since it's a number field it won't let you enter commas or wildcard entries.
Go to "List Settings". Click on your Number field. Under "Additional Column Settings" specify the minimum and maximum values as 10000 and 99999 respectively.
With respect to comma, SharePoint puts a comma where appropriate. So a number
43000 would be displayed as
43,000. As for wildcard characters as it is a Number field it won't allow them to be save to List.