How to update list value in servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2020 02:23 AM
How to update list field using background script, will set value will work here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2020 02:35 AM
I will check that between can you send me how to update for list fields.. because set value will not work for list...right?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2020 02:37 AM
did you try with the script which i had shared ? you have to pass the sys_id of that record which you want to update into list field. can you add some screenshot if that is not working.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2020 02:55 AM
Ohh seems bit late now but for future references you can do below.
1. Once you have configured above property by removing glide_list from the Value field
2. Go to the list view.
For eg. Open a Group table where you will to have Type updated to multiple options from human_resources to have itil as well. So, apply necessary filter to the List & then update Type field for 1 record.
Suppose in case above HR Tier 3 was updated with ITIL type. Then,
Do a list update by selecting it directly from list view.
For the code part comments are already provided by Harshvardhan & Sudhanshu & should help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2020 02:37 AM
Is the code correct?
var com = new GlideRecord('core_company');
com.addQuery('name','ACME Australia');
com.query();
while(com.next){
com.u_type = "00aba08d3790200044e0bfc8bcbe5dfc";
com.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2020 02:39 AM
for testing add setLimit so it will update one record only and then you can test for all after confirmation.
var com = new GlideRecord('core_company');
com.addQuery('name','ACME Australia');
com.setLimit(1);
com.query();
while(com.next){
com.u_type = "00aba08d3790200044e0bfc8bcbe5dfc";
com.update();
}