create multiple RITM

Sneha39
Mega Guru

How can i create multple ritm ( simple way) from workflow .

 

 

8 REPLIES 8

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

A request is simply a record of a cart transaction.

A request item is each individual item ordered as part of the transaction.

So, just add each item to the card individually and then submit, it will create multiple RITMs in the same Request.

If I have answered your question, please mark my response as correct and/or helpful.

Thank you very much

Cheers
Alberto

Utpal Dutta1
Mega Guru

Hey Sneha,

 

I understand that you want to know about Request and RITM in ServiceNow.

So let's start with Request:

Request in ServiceNow is generated whenever you order something using Service Catalog. A single request servers a single order. Just like you order something on flipkart or amazon.

When a user creates a request in ServiceNow, system creates a new task for that service category you are ordering.

 

RITM:

RITM stands for (Requested Item). RITM comes handy when we want to order multiple catalog items by raising a single request. You must have seen that (Add to cart) button when you were ordering something using service catalog. Now when you order multiple catalog items using (Add to cart) only single Request is generated but Multiple RITMs will be generated. Each RITM indicating a single catalog item.

 

To generate Multiple RITMS in WorkFlow you need to loop in the WorkFlow Script

 

Use script:

 

If cost_center = a,b,c,d;

var allCostCenters = current.variables.cost_center.split(',');

current.variables.cost_center = allCostCenters[0];

 

for(var i = 1;i<allCostCenters.length;i++) {

 

      var cart = new Cart();

 

      var item = cart.addItem(current.cat_item);

 

      cart.setVariable(cost_center, allCostCenters[i]);

 

      cart.setVariable(set other variables);

 

      var rc = cart.placeOrder();      

 

}

 

I hope i was able to solve your query, please mark my Comment Helpful and Correct.

 

Thanks and Regards:

Utpal Dutta

DxSherpa Pvt.Ltd. 

Hi,

I want to create two RITM from one catalog item only ( through workflow) and i want to set different location ( for RITM1 = ISM, FOR RITM2 = KRT)

how can i achieve this. 

With your code I have generated multiple Request with Request item for each, am i missing some code ?