Please help me how to validate UUID format in Server side scriptbelow script always returning "Not V
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2025 11:49 PM
Please help me how to validate UUID format in Server side scriptbelow script always returning "Not Valid"
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2025 07:31 PM
Not sure, what your question is about and the mentioned code is also missing.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2025 07:44 PM
Try the below script.
var uuid = 'f47ac10b-58cc-4372-a567-0e02b2c3d479'; // replace with your UUID variable
var uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
if (uuidRegex.test(uuid)) {
gs.info('UUID is valid');
} else {
gs.error('UUID is invalid');
}
Regards,
Siva
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2025 08:06 PM
what's your business requirement?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader