How to creat request item from Transform map

busireddy
Tera Contributor

I have created an transform and I choose the target table as "sc_target" and I have created the onBefor transform map script as below

 

var cart = new Cart();
var item = cart.addItem('10dacbc1db3b6300bdb98edf4b9619ee');
//Set Variables in your Cart Item
var cartmsg = "Import Set: " + source.sys_import_set.table_name +', Datasource:'+ source.sys_import_set.data_source;
cart.setVariable(item,'pipeline',current.variables. level_of_access);

var rc = cart.placeOrder();

when I run transform map it's creating only sc_request but it's not creating sc_req_item.

So kindly help us how to create sc_req_item via transform map?

 

 

 

 

 

20 REPLIES 20

Community Alums
Not applicable

Hi,

 

What is the current record in this line?-

cart.setVariable(item,'pipeline',current.variables. level_of_access);

 

Also, can you please tell what is the state and approval of REQ that is created?

don't consider this line of code, and I have checked that two step check out vauues is True, so helo us how to create an ritm from transform map.

Hi,

Did you try running the script in background? what it behaves?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

don't consider on this line code

cart.setVariable(item,'pipeline',current.variables. level_of_access);

all I need to know how rtim should create from transform map

Hi,

If that line is to be ignored then how are you setting the variables?

can you share the transform map script here? it is present in onBefore or onAfter?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader