- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2025 01:26 AM - edited ‎03-26-2025 01:32 AM
I have created mobile number variable on record producer and type is single line text, as of now letters and numbers both are allowing to enter, so I tried with Variable attributes - max_length=10
it is restricting length 10 but it is allowing both numbers and letters, also I tried to create question_regex record and added below code, but still it is allowing both and more than 10 as well
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2025 07:16 PM
Hi @suresh101 ,
yeah update the regex to ->
04\d{8}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2025 01:40 AM
Hi @suresh101 ,
Try this out
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2025 07:04 PM
Thank you @Chaitanya ILCR
it should start from 04 only, is it possible to do in regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2025 07:16 PM
Hi @suresh101 ,
yeah update the regex to ->
04\d{8}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2025 01:48 AM
Hi @suresh101 ,
Out-of-the-box there exists a field type "Phone Number (E164)" that can be used to validate phone number formats.
You can refer to the scripts mentioned in these threads :
https://www.servicenow.com/community/developer-forum/need-to-limit-to-10-digit-number/m-p/1373386