- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
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!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Instead of mapping the data pill to the request number, keep it mapped to the request record itself.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
I am creating a flow for a req item that requires this functionality. Creating a report might not be the solution here. But appreciate the response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
when I try to look for records on sc_req_item with request=REQxyz, it returns no record. However, when I list the sc_req_item in console, and filter the table with request=REQxyz, I do get all the RITMs under that Req.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Can you share the flow designer code snippet, maybe some condition is incorrect.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
if your flow is on Service Catalog you have the RITM record.
You can then use Lookup Record on sc_request table with this filter and it should give you REQ record
Another way to get list of all RITMs under the current REQ is this, it will give you all RITMs
If you want to exclude the current RITM then add extra condition as this
Sys Id [IS NOT] Trigger->Service Catalog->Requested Item Record->Sys Id
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader