Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How do I get list of RITMs for a given REQ in flow designer?

aryanjain27
Tera Contributor

Hi,
I am using a "Look up Record" to get the REQ record. I am able to get that but in the output I do not see anything that says Requested Items. When I go to the REQ record and scroll down, I do see the list of RITMs on it under requested items tab, but how do I get those numbers/their sys ids, in flow designer? If not directly in flow designer, is it possible to create an action and write a script to get that?

 

Thnx in advance!

2 ACCEPTED SOLUTIONS

M Iftikhar
Tera Sage

Hi @aryanjain27 ,

When you look up a REQ (sc_request) record with Look Up Record, you’re only getting the fields from the sc_request table itself. The Requested Items (RITMs) you see on the form are from the related table sc_req_item, which has a reference field request pointing back to sc_request.

Options:

1. Use Look Up Records 

  • In Flow Designer, instead of "Look up Record" , use Look up Records.
  • Table: sc_req_item
  • Condition: request =  map the REQ sys_id you got earlier.
  • This will return a list of RITMs for that REQ.
  • You can then loop over them using For Each to get each RITM number or sys_id.

2. Script Action

Yes, you can create a custom action with a Script step to achieve the same.

Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

View solution in original post

Instead of mapping the data pill to the request number, keep it mapped to the request record itself.

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

View solution in original post

15 REPLIES 15

When I search the sc_req_table for request=REQxy17 I get this:
aryanjain27_0-1757602205247.png

The same when I try in the flow designer "look up records":

aryanjain27_1-1757602602140.png

aryanjain27_2-1757602741945.png

 

Instead of mapping the data pill to the request number, keep it mapped to the request record itself.

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

This works like a charm! Thnx a lot!

Happy to help, keep learning!

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

Rafael Batistot
Kilo Patron

Hi @aryanjain27 

 

If you need the list of RITMs, may you try via report, you don’t need flow for it 

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0819688

If you found this response helpful, please mark it as Helpful. If it fully answered your question, consider marking it as Correct. Doing so helps other users find accurate and useful information more easily.