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.

Query for Related Records on Related List

Nic Omaha
Tera Guru

Having some trouble writing a query for my relationship. I have a custom table called "u_ppi_database". Records on this table can generate a

"REQUEST" which I have populating on the form as shown below. The field on request is "number" and my custom field is "u_request_number". I am trying to get a

related list that shows the request in that field above. Everything I try either shows ALL requests or none at all.

CUSTOM TABLE

find_real_file.pngfind_real_file.png

7 REPLIES 7

nagaraniracharl
ServiceNow Employee
ServiceNow Employee

Can you please share the screenshot/details of the 'Relationship' you created?


I have all types of scripts and cant seem to get anything to work. Here is the last one I tried. find_real_file.png


Can you please try replacing your script in 'Query with' with the below statement?


current.addQuery("sys_id", parent.u_request_number);


(Just remove everything in that field and try only with the above statement)