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

How do I compare two reference field value?

Sid_Takali
Kilo Patron

Hi all,

I have a scenario where I have to create Relationship in two tables (Related List). Applies to table is "Case" and Queries from table is "Custom" Table. There is a common reference field in both the table and that refers another table. So how do I compare a reference field from "Case" Table and "Custom" table. 

 

Thanks

1 ACCEPTED SOLUTION

Hi @Sid_Takali ,

Yes I got it. You have the case table and custom table. custom table the case reference field and case table has the custom table field.

we can display related data on custom table which is using on case and vice versa.

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

View solution in original post

6 REPLIES 6

Pavankumar_1
Mega Patron

Hi @Sid_Takali ,

you are planning to get the custom table records which is using case and show those specific records on cases related list.

(function refineQuery(current, parent) {
    current.addQuery('casereferencefield', parent.sys_id); //give the case rference filed name which is on custom table.
})(current, parent);
If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

Hi @Pavankumar_1  Thanks for your prompt response. 

but the thing here that the common field between these two tables is reference field, no other field is common in between. There is no parent field on custom table.

 

Thanks

Hi @Sid_Takali ,

Yes I got it. You have the case table and custom table. custom table the case reference field and case table has the custom table field.

we can display related data on custom table which is using on case and vice versa.

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar