- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
I am trying to push a value into a field using a background script. After running the script, it shows that the field was modified, but the value is not updated in the field. Could you please review the code and let me know the solution?
it's showing KB updated successfully
var gr = new GlideRecord('kb_knowledge');
if (gr.get('KBarticle sys_id')) {
gr.setWorkflow(false);
gr.setValue('taxonomy_topic', 'value sys_id ');
gr.update();
gs.info('KB updated successfully');
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
No issue in the script. Make sure you are running the script in Global scope.
Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi
Can you check the dictionary for taxonomy_topic? If its reference/related field then you must update the relationship table not the field.
Also in your 4th line of code there is an extra space..Can you check that too?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
are you able to update it from UI?
are you able to update it from list via Data Management?
are you giving correct sysId?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
No issue in the script. Make sure you are running the script in Global scope.
Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi @bhanukota09
In Order to update topic , you need connecting a Knowledge article to a Taxonomy topic involves creating or updating a record in the m2m_connected_content table, which links content (Knowledge, Catalog Items, etc.) to the Unified Taxonomy.
Check the sample code from following post:
