- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 04:35 AM
Hello,
We have a table where I should modify several 100 records, so was thinking about a fix script. But whatever I try is not working and as I'm quite new to scripting, some help would be appreciated.
So on the table we have a field what is a glide_list type, and already has 1 or several values. Now I would need to add an extra value for all via a fix script in a way that the current values will stay in place.
If I try to query via a bancground script it shows correctly, but in realty when checking the record no data is being refreshed/updated.
gs.print(gr.cmdb_model_category);
gr.cmdb_model_category = existing_value + ',' + '0be11f58c7432010f74c784c95c260b7'
gs.update();
gs.print(gr.cmdb_model_category);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 06:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 04:38 AM
do this
gs.print(gr.cmdb_model_category);
gr.cmdb_model_category = gr.cmdb_model_category.toString() + ',' + '0be11f58c7432010f74c784c95c260b7';
gs.update();
gs.print(gr.cmdb_model_category);
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 10:20 PM
it is working oerfectly of there is onlt one category assigned, but if there are more then one like 2 or 3 assigned already, then it is deleting one and adding the new one.
So if category was 'Laptop PC' and 'Laptop' as well, it would remove the Laptop category and add the new one so at the end will have 'Laptop PC' and 'Mobile Device', but here I would need that the original 2 will stay and the new one would be added. so would have 3 category after the script. Could you help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2023 09:09 PM
Please share the entire script as it's difficult to get the full context
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 06:51 PM
Not sure if you picked up that "gs.update()" should be gr.update() !