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.

Cannot retrieve batch input from RTE Entity Multiple Input Script Operation

DharshaniR
Tera Expert
This is the script I am using to log the input source fields(Action and IncidentNumber) in RTE entity mappings. I am able to get the log for ticket number but not for action. Any weird reason why?
 
(function(batch, output) {
for (var i = 0; i < batch.length; i++) {
 
var a = batch[i].u_action;
var b = batch[i].u_ticketnumber;
gs.log('RTE PD:a ' + a);
gs.log('RTE PD:b ' + b);
 
})(batch, output);
1 ACCEPTED SOLUTION

Hello @Bernard295C , thanks for your input. I verified the batch data, it was just fine.

 

I identified the issue was with the order of the script, that the batch input (u_action) was successfully captured in the log of the first script that got executed. So changing the order worked for me.

 

View solution in original post

3 REPLIES 3

Bernard295C
Giga Contributor

@DharshaniR wrote:
This is the script I am using to log the input source fields(Action and IncidentNumber) in RTE entity mappings. I am able to get the log for ticket number but not for action. Any weird reason why?
 
(function(batch, output) {
for (var i = 0; i < batch.length; i++) {
 
var a = batch[i].u_action;
var b = batch[i].u_ticketnumber;
gs.log('RTE PD:a ' + a);
gs.log('RTE PD:b ' + b);
 
})(batch, output);

Hello!

If the script isn't logging the u_action field, check the field name for accuracy, ensure it has values, confirm script scope, and verify batch data. Logging the entire batch element might help identify the issue:

javascript
gs.log('RTE PD:Batch Element ' + JSON.stringify(batch[i]));
I hope this helps!

Hello @Bernard295C , thanks for your input. I verified the batch data, it was just fine.

 

I identified the issue was with the order of the script, that the batch input (u_action) was successfully captured in the log of the first script that got executed. So changing the order worked for me.

 

Bernard295C
Giga Contributor

Hello!

I trust this answer will be of great help! 

Best Regards,

My Results ATT