Robust Transform Engine operations

Prithvi Ramesh1
Mega Sage

Can anyone suggest how can we use Robust Transform Engine operations in servicenow?

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @Prithvi Ramesh1 

 

First of all there are so many operations in RTE Entity Operations and I use hardly two type of operations like script and concatenation.

So like most of our work we can cover with scripting and they provide us the basic template that we can use like 

 

(function(batch, output) {
     for (var i = 0; i < batch.length; i++) {
 
         //step1: access the input variables
         var a = batch[i].input; //Value of the source field. 
 
         //step2: Your script/code goes here.
         var b = a + 1;
 
         //step3: set the output for each elements
         output[i] = b;
     }
 
 })(batch, output);
 
We can use Glide Record as well to fetch any data from the table and we can concatenate any string part and set it on output by setting the value of output like output[i] = "AnyString"+ b + "AnyString";
 
Thanks and Regards 
Sarthak

View solution in original post

3 REPLIES 3

AJ-TechTrek
Giga Sage
Giga Sage

Hi @Prithvi Ramesh1 ,

 

Refer the below docs URL which may help you.

 

https://docs.servicenow.com/bundle/tokyo-platform-administration/page/administer/import-sets/task/de...

 

https://docs.servicenow.com/bundle/tokyo-platform-administration/page/administer/import-sets/concept...

 

Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.

 

Thanks

AJ

Linkedin Profile:- https://www.linkedin.com/in/ajay-kumar-66a91385/

ServiceNow Community Rising Star 2024

Community Alums
Not applicable

Hi @Prithvi Ramesh1 

 

First of all there are so many operations in RTE Entity Operations and I use hardly two type of operations like script and concatenation.

So like most of our work we can cover with scripting and they provide us the basic template that we can use like 

 

(function(batch, output) {
     for (var i = 0; i < batch.length; i++) {
 
         //step1: access the input variables
         var a = batch[i].input; //Value of the source field. 
 
         //step2: Your script/code goes here.
         var b = a + 1;
 
         //step3: set the output for each elements
         output[i] = b;
     }
 
 })(batch, output);
 
We can use Glide Record as well to fetch any data from the table and we can concatenate any string part and set it on output by setting the value of output like output[i] = "AnyString"+ b + "AnyString";
 
Thanks and Regards 
Sarthak

EricG2
Tera Expert

@Community Alums 

Quick question.   In your "Scripted Operation", have you found that it adds a leading space to the Output?

I have a script, where I take an employee ID from my staging table, query the User table for a match, and return the sys_id of the user.   I then use this to populate the User's Manager when i update or add them.

Suggestions?  my output is placing a space before the sys_id, so the reference user field doesn't populate correctly.

I've added the Output[i] to a gs.info log to verify what the script is returning.