Using a database view in a simple list in UI Builder

Ivar Donado
Mega Sage

Hi guys,

 

I'm currently working on making a custom Agent workspace for a customer.  In this workspace they want some "reports" in the landing pages that are similar to the ones they have in some dashboards, The issue I have come across is that some of those reports are built over a database view. Data visualizations in UI builder allow using database views, but simple lists don't.

 

I tried creating a data resource instance with Lookup records, but that doesn't allow using database views either it seems.

 

Is there any way?

1 ACCEPTED SOLUTION

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Yeah I don't think database views are selectable as a table in that component, but there is a workaround/hack to get them to display using a client state parameter as shown in this screenshot (incident_metric is a db view table).

 

CleanShot 2022-10-06 at 08.59.15@2x.png

View solution in original post

11 REPLIES 11

You can just script the table name too without using client state.

Also an FYI, value of @payload.sys_id is the sys_id of the incident (in my spotlight example). So if anyone needs to know, you can use @payload.sys_id in the event handler

Hi @Brad Tilton This works ! But can you please tell me how to add Database View list to Workspace view. I am unable to change the list layout.

Hi @Radhika1. Were you able to find the solution? I am looking to do something similar

You can't add a database view to the list menu in workspace currently.

Hello Brad,

Thanks for that. Very helpfull. The missing part is to How can this page be displayed in the standard left menu in configurable workspace in an existing category (through sys_ux_list) ?

Thanks for your help.