Can we Replace Sys id with Another sys id ...for all the Records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 03:04 AM
Hello All ,
I Got the case where we found there was issue with user profile and to solve this we have craete the new user profile .
but the old profile is link to multiple dashboard ,reports and other records .
it is possible to replace new user sys id to old sys id ? or any other solution is there so we can replace user with new one .
Please help here
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 03:14 AM
It is not feasible to change the existing sys_id.
You can try with background script but it is not advisible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 08:04 AM
Hi
It is not possible to change sys_id for a record
Because sys_id is unique and it cannot be changed and it is given by system so user does not have right to change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 10:11 AM - edited 03-04-2024 11:22 AM
Hi @Rakesh Patel1 ,
No you can not replace old sys_id with new one.
But you can create your own sys_id basically when creating new records, ServiceNow automatically generates a unique sys_id. Though at some rare places in the system you'll notice there isn't actually a 32-character sys_id used but just a string.
So could we do this ourselves? For example on a User record, with your own firstname.lastname or your nickname? Yes, you can!
You only have to apply setNewGuidValue. Note this will only work for new records, not for updating records.
You can use gs.generateGUID() will give you always a unique key and set it as a sys_id.
Please mark this response as correct or helpful if it assisted you with your question.
Regards,
Mansi Pardeshi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 10:25 AM
Hi @Rakesh Patel1 ,
It is not best practice to replace sysids of records. Because if any scripts are running based on sysids, those scripts will fail.
Please refer to the below thread for the approach of replacing sysids:
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda