how to update the CatLog item variables data from the workflow script activity
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
how to update the CatLog item variables data from the workflow script activity
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @hemantnh ,
Please check some url's
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @hemantnh ,
please elaborate a little further - what are you trying to achieve?
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You can update catalog item variable data in a workflow script activity, but you have to do it on the requested item (RITM), not the catalog item directly...
var ritm = new GlideRecord('sc_req_item');
if (ritm.get(current.sys_id)) {
ritm.variables.your_variable_name = 'new value';
ritm.update();
}
Alternatively, in Flow Designer, you can use a custom Action (script type) to set a catalog variable:
inputs.requested_item.variables[inputs.variable_name].setValue(inputs.variable_value);
inputs.requested_item.update();
outputs.state = 'success';
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/