Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to send the variable of "a" is item response from client controller to server script in widget.

Gopal Allu
Tera Expert

Hi team,

 

I am trying to send the variable "a" data in "SC Catalog Item" widget. which is a response of the request created.

 

GopalAllu_0-1711099947467.png

 

I need to send the sys_id of the record created by this response object.

 

In client controller:

c.data.reqsysid = a.sys_id;
 

In server script:

gs.addInfoMessage(input.reqsysid);   tying to access like this, but failed to show the sysid. It is showing as undefined.

 

Thanks and Regards,

Allu Gopal.

1 REPLY 1

Murthy Ch
Giga Sage

Hi @Gopal Allu 

In client controller, try something like below:

$scope.data.reqsysid = a.sys_id;

Make sure a.sys_id holds some value in it.

 

Thanks,
Murthy