how to update the CatLog item variables data from the workflow script activity

hemantnh
Tera Expert

how to update the CatLog item variables data from the workflow script activity

3 REPLIES 3

AndersBGS
Tera Patron

Hi @hemantnh ,

 

 please elaborate a little further  - what are you trying to achieve?

 

kaushal_snow
Giga Sage

@hemantnh ,

 

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.