Unable to set unique field to true on one of the user table column
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @VishalC3
You should Check for duplicate records first(emails/employee numbers).Change with the correct data or remove duplicates .Then create unique database indexes for the fields u want to make unique.
If you want to find duplicate emails in the sys_user table quickly.
1.Go to the sys_user table
2.Filter out (email is not empty)
3.Right click the Email column header
4.Select Group By Email.
If this helped point you in the right direction, please mark it as Helpful or Accept as Solution!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
already user_name field is unique on sys_user table at database level
why you want another one?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
HI Ankur,
We want to make sure employee id and emails are unique too. This has come up as finding in Health Scan finding.
Thanks,
Vishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @VishalC3 ,
The ootb approach is Unique Table Index.
Creating one is very simple: Open up the Table [sys_db_object] record for your Thing table. Scroll to the bottom to find Database Indexes and click New.
This will restrict the duplicate entries :
Refer this for more detail :
If my response helped mark as helpful and accept the solution.
