Custom action script not updating the records

SHALIKAS
Tera Guru

I have defined the inputs in custom action as -

SHALIKAS_0-1713337009125.png

The script is as -

(function execute(inputs, outputs) {
var gr=new GlideRecord('sc_request');
gr.addQuery('sys_id','inputs.request');
gr.query();
if(gr.next())
{
gr.short_description = inputs.shortdescription;
gr.update();
}

})(inputs, outputs);
 
In flow defined the inputs as -
SHALIKAS_1-1713337101147.png

But it not updating the sc_request record

1 ACCEPTED SOLUTION

Apart from defining inputs for the action, have you defined input variables in the script step?

 

Sonam_Tiwari_0-1713342919870.png

 

Sonam_Tiwari_1-1713342915931.png

 

You can define outputs for tracking but updates of record is not dependent on defining outputs.

 

Consider indicating the response as helpful and marking it as correct if it meets your needs.

View solution in original post

3 REPLIES 3

Sonam_Tiwari
Kilo Sage

Hi @SHALIKAS ,

 

Remove quotes around inputs.request.

 

Keep it as : gr.addQuery('sys_id',inputs.request);

 

 

 

 

Consider indicating the response as helpful and marking it as correct if it meets your needs.

Hii,

I did that still it is not updating,
I have not defined any output in custom action, do I need to do that

Apart from defining inputs for the action, have you defined input variables in the script step?

 

Sonam_Tiwari_0-1713342919870.png

 

Sonam_Tiwari_1-1713342915931.png

 

You can define outputs for tracking but updates of record is not dependent on defining outputs.

 

Consider indicating the response as helpful and marking it as correct if it meets your needs.