Related list on sc_req_item

Rajkumar Bommal
Tera Contributor

i Have created a catalog item 
when it proceeded to sc_req_item table i want to display already created records with same variable value records in related lists 
here is the demo for the realated lists 
past compliments : spefify staff is catalog item variable 
current req item record specify staff record also same so in related lists same specify staff records has been displaying 
 

RajkumarBommal_0-1740991412424.png

 

 


how can i archive that

1 ACCEPTED SOLUTION

@Rajkumar Bommal 

okay in related list you want to show the variable

check this link on how to add variable in related list

Article #19 - How to show Catalog Variables on RITM Lists 

I hope I have answered your question and you can now enhance it further.

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

View solution in original post

11 REPLIES 11

Debasis Pati
Tera Guru

Hello @Rajkumar Bommal ,

You need to create a relationship for that and then add the ralation ship to the related list in the relationship you can put your query in order to filter the ritms.

Example:
var gr = new GlideRecord('sc_req_item');
gr.addQuery('variables.specify_staff', current.variables.specify_staff);
gr.query();


Please mark it as correct/helpful if this helps you.

Regards,
Debasis


@Debasis Pati 
I know that it can be done bye creating relationship and add it to related list but i want the query that need to used to get this 

 

Shubham_Jain
Mega Sage

@Rajkumar Bommal 

 

Solution Approach

1️⃣Create a Reference Field (If Not Already Present)

  • Ensure that the Specify Staff variable is stored in the sc_req_item table as a field (e.g., u_specify_staff).
  • If it’s not, create a custom field (Reference type) on sc_req_item to store this value.

2️⃣Configure a Related List Based on Matching Records**

  • Navigate to System Definition → Related Lists.
  • Configure a new related list on the sc_req_item form layout.
  • Set it up to show records where u_specify_staff is the same as the current record.

3️⃣Use a GlideRecord Query in a Business Rule

  • Create a Business Rule on sc_req_item that dynamically fetches related records.
  • The Business Rule should run on Insert to display past records where u_specify_staff matches.

 

✔️ If this solves your issue, please mark it as Correct.


✔️ If you found it helpful, please mark it as Helpful.



Shubham Jain


@Shubham_Jain Can you please give me a script