- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 09:54 PM - edited 12-12-2023 11:13 PM
Run script not working in Workflow - but working in BACKGROUND SCRIPT
var sys_id_maintain = current.variables.product_catalog_item;
var grAppIns = new GlideRecord('sc_cat_item');
grAppIns.addQuery('sys_id', sys_id_maintain);
grAppIns.query();
//update the catalog item with source values
while (grAppIns.next()) {
grAppIns.setValue('name', current.variables.description);
grAppIns.update();
}
Type of current.variables.description is 'HTML' and in sc_cat_item the type of variable for description is 'Translated HTML'
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 04:35 AM
Thank You for all your help.
Created scratchpad variables to save current.variable values and tried update. It worked

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 03:38 AM
Hi @Jagadish Sanadi ,
Can you try
grAppIns.name = current.variables.description.toString(); instead grAppIns.setValue('name', current.variables.description);
1)i would also make sure i am getting expected sys_id of the catalog item in "sys_id_maintain"
2)Check if info/errors logs in the workflow
3)i would also check the system has access to update the name field on the catalog item by validate "grAppIns.canWrite()" in while condition
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 04:35 AM
Thank You for all your help.
Created scratchpad variables to save current.variable values and tried update. It worked