Create multiple "RITM's" under the "REQ" based on the quantity

F_bio Santos
Kilo Sage

Hi everyone, is it possible for the "REQ's" to have multiple "RITM's" under it based on the "quantity" inputed by the user?

For example:

If the quantity is 2 the REQ should have 2 RITM on the related list.

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@F_bio Santos 

That's not what the quantity means in ServiceNow. What's the point in having multiple RITMs under same REQ with same information?

if you still require this then check this

Create multiple RITM under single request depending upon list collector values through workflow 

How to create multiple Ritms under one request for different catalog item? 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Ankur Bawiskar
Tera Patron
Tera Patron

@F_bio Santos 

If you are using BR then I shared solution for something similar earlier, you can enhance it for quantity rather than MRVS

Multiple RITM's for single request based on the MRVS selection 

another solution shared here

Request Items from one Multi Row Variable Set 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

MackI
Kilo Sage

hi @F_bio Santos 

 

Yes, it is definitely possible for a REQ (Request) to have multiple RITMs (Requested Items) in ServiceNow based on the quantity entered by the user, and you can achieve this with a relatively small amount of scripting combined with some no-code configuration.

Here's a breakdown of how you can achieve this, along with options for minimizing code:

Understanding the Challenge

The standard behavior in ServiceNow is that a single REQ creates a single RITM, which then potentially creates multiple SCTASKs (Catalog Tasks) for fulfillment. Your requirement introduces the need for dynamic RITM creation based on quantity.
 

No-Code Part (Configuration):

Catalog Item Setup: Ensure your catalog item has a "Quantity" variable (of type Integer).
Workflow Design: Create a workflow for your catalog item. The workflow should handle the standard process of order fulfillment (approvals, tasks, etc.).
 
Create an Custom Action Script (Potentially Low-Code) on the flow Design UI interface by creation Action.

Go to "Flow Designer" within your Experience Work Studio application.

Create a new Action Script on Flow UI interface 

How it achieves dynamic creation based on quantity:

The for loop script is the key. It iterates a number of times determined by the inputs.quantity value. Each time the loop runs, it creates a new RITM record. So, if the user enters a quantity of 4:

The initial RITM is created (triggering the Flow).
The loop runs 3 times (4 - 1 = 3).
Three additional RITMs are created and linked to the same REQ.
request (Reference to sc_request) - The REQ record.
catalog_item (Reference to sc_cat_item) - The catalog item.
quantity (Integer) - The quantity entered by the user.
 
please share the summary of your project story and what you try to achieve then , I can analyze it properly and help you out accordingly.
 
If you like this opinion and your problem is resolved after reviewing and applying it. Please kindly mark this your best answer‌🌠‌ OR  mark it  Helpful â€Œâ›‘‌ if you think that you get some insight from this content relevant to your problem and help me to contribute more to this community
MackI | ServiceNow Developer | 2 *Mainline Certification | LinkedIn Top IT Operation Voice 2023 | Sydney,Australia