background script to update user information
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2016 08:59 AM
Table : sys_user
I am trying to run a piece of code , its not working , i would like to get people inputs ,
We need a background script to update the Employee Number for all people with a User Brand = "Beta""
to add "Beta:" as a prefix to the existing Employee Number.
So it should display as " Beta: 25467".
Code :
function addPrefix(){
var gr = new GlideRecord("sys_user");
gr.addQuery('sys_id',"bac617ddd56c8104583a92146e8f872a");
gr.addQuery('u_user_brand', 'Beta');
gr.query();
while(gr.next())
{
gr.user_brand = gr.employee_number.replace('Beta:');
gr.update();
}
}
addPrefix();
- Labels:
-
Service Mapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2016 09:32 AM
dan.bruhn can you assist?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2016 09:34 AM
Some users do not see the Correct Answer link (per this video at 20:00 https://community.servicenow.com/thread/224893). Let me know if you do not see it and I can get a community moderation to assist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2016 09:52 AM
Went through the video link Pradeep , I dont see the "Correct Answer button " on my screen and when i drag down actions , "No actions are available "
Thanks for your time

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2016 09:54 AM
Thank you Sree,
I've tagged on of the community moderators to look in to it. We thought we had this issue resolved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2016 09:59 AM
Thanks Tomasi