Adding fields from a different table that are not linked via reference fields to a list view

mugi-san
Kilo Sage

Hello everyone.

 

The fields I want to add to the list do not exist in the current table, even as reference fields.

Is it possible to use an existing field in the table to query a separate table and then display fields from that "result record" in the list view?

 

I am aware that there are various workarounds and best practices for data structure.

However, if there is a specific feature or function that can fulfill this requirement directly, I would appreciate your guidance.

2 REPLIES 2

adityahubli
Tera Guru

Hello @mugi-san ,

 

You can try Database View in which it joins tables .Database view create one virtual table in which you can store multiple table records together if they have certain relationship only.If both tables are related through a common field (like sys_id or number), create a Database View to join them and display fields from both tables in one list view.

or you can 

1)Add a Reference Field
Create a reference field on the current table that points to the other table, then use dot-walking to display fields from the referenced record in the list view. This is the best and recommended approach.

 

2)Populate Fields Using a Script
Use a Business Rule or Scheduled Job to query the other table and copy the required values into fields on the current table so they can be shown in the list view.

 

You can refer this short video you get idea about database view.

https://youtu.be/_JY462TmXxU

In this ServiceNow Tutorial, Aaron Elder gives a demo on creating and using a database view in ServiceNow. Create the database view. Role required: admin. Learn more: https://docs.servicenow.com/bundle/paris-platform-administration/page/use/reporting/task/t_CreateADatabaseView.html ...

Its_Azar
Kilo Sage

Hi there @adityahubli 

 

This is not supported out of the box. ServiceNow list views can display only fields from the same table or fields accessible through reference dot-walking. You cannot use an existing field to dynamically query an unrelated table and show its fields in a list. butg, you can try adding a reference, creating a Database View, populating a calculated/stored field via server logic, or building a custom UI (widget or page). these are the alternatives

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.

Kind Regards,

Mohamed Azarudeen Z

Developer @ KPMG