The CreatorCon Call for Content is officially open! Get started here.

Multiple RITMs under 1 REQ

phugill
Tera Expert

 

Hi Community,

I’m trying to figure out the best way to create multiple Requested Items (RITMs) from a single Catalog Item submission.

Use case:

  • We have one catalog item with several checkboxes. (It Systems, Information Security, Finance)

  • When the form is submitted, I want a separate RITM created for each selected checkbox.

  • Each RITM should contain the same variable values, but be assigned to a different group depending on which checkbox was selected.

  • All RITMs should roll up under the same REQ, and ideally be displayed on their own tabs within the request.

What I’ve tried so far:

  • Order Guides → but we want this to happen without extra clicks or navigating to multiple screens.

  • Cart APIs → I’ve tested a few approaches but haven’t been able to get them working for this use case (maybe I’m not setting them up correctly).

  • Workflow → I have a workflow triggered when the catalog item is submitted that checks each checkbox, but I don’t know how to branch it into separate RITMs.

  • Custom Action → I tried adding a custom action, but it doesn’t seem to show up as an option when I go to use it.

Has anyone successfully implemented this pattern before? My main focus is to drive this through Flow Designer. We have not implemented multiple RITMs in our environment before. 

Any best practices, code samples, or pointers would be hugely appreciated.

Thanks

Philip H

1 ACCEPTED SOLUTION

phugill
Tera Expert

I wanted to share the solution I was able to build in Flow Designer without using any custom actions or scripting.

I started with a Service Catalog trigger, then used Get Catalog Variables to retrieve the specific variables I needed.

phugill_0-1759507980165.png

To associate multiple RITMs with the REQ, I added a Look Up Record on the sc_request table to retrieve the Sys ID of the parent request.

phugill_1-1759508021050.png

From there, I applied If / Else If conditions based on the catalog variable checkboxes:

  • If IT Systems is true → update the primary Request Item record.

  • If Finance is true → create a Request Item record.

  • If Information Security is true → create a Request Item record.

phugill_2-1759508057912.png

For the Else If conditions:

  • If Information Security is true and IT Systems is false → update the primary Request Item.

  • If Finance is true → create a Request Item record.

phugill_3-1759508107225.png

For the final Else condition:

  • If IT Systems is false and Finance is true → update the primary Request Item.

  • If Information Security is true → create a new Request Item record.

phugill_4-1759508146854.png

Finally, I used an Update Request Record step.

phugill_5-1759508177379.png

The tricky part was ensuring that updates to the REQ didn’t wipe out values when non-primary RITMs were being updated (since the primary has the flow context attached to it). My workaround was to use the Look Up Trigger Service Catalog Request Item record to pull values from there.

phugill_6-1759508220882.png

Attempting to populate the REQ directly from the catalog variables would cause errors, but pulling them from the trigger record worked reliably.

 

I hope this helps!

 

 

View solution in original post

13 REPLIES 13

RaghavSh
Kilo Patron

@phugill Order guide gives user the capability to select the variable while submitting the catalog items.

Since all variables should have same variable value, you can easily use cart APIs, what issue are you getting while using CART APIs?

 

Are you write cart API code in workflow script?  Can you share your script? 


Raghav
MVP 2023
LinkedIn

@phugill Did this answer your query?


Raghav
MVP 2023
LinkedIn

Ankur Bawiskar
Tera Patron
Tera Patron

@phugill 

I have written blog for this, you can refer that and enhance, it uses Cart API, but you can enhance it to use CartJS

Multiple RITMs in same Request Using CartAPI 

CartJS links

CartJS - Scoped 

Understanding sn_sc.CartJS() in ServiceNow: Its Importance and Use Cases 

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