Update Set with Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2023 04:20 AM
Hello everything is fine?
How to perform an update, by Script background, in ServiceNow?
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2023 04:31 AM
Can you please elaborate on your use case?
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2023 04:38 AM
Hello everything is fine?
I need to do a massive update, I need to move from DEV to Prod, several updates per Script.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2023 04:42 AM
Ok, and what exactly do you need help with? The script itself, or how to call it?
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2023 04:59 AM
var gr = new GlideRecord('u_table');
var string='active=true^state=2';
gr.addEncodedQuery(string)
gr.query();
while(gr.next())
{
gr.setWorkflow(false);
gr.autoSysFields(false);
gr.state = 'committed';
gr.update();
}