Same table different label?

Joey Wan Kenobi
Tera Guru

Hi all,

I'm wondering if something is possible regarding pulling up the list view of a table. It sounds strange, I know, and i am pessimistic about the possibility of it, but here goes:

When viewing the list view, you see the plural table label in the top left corner. I have 2 links that point to the same table, but each link has a different filter. Is it possible to change the label that appears in the top left corner of the list view based on which link has been clicked?

2 REPLIES 2

Brad Tilton
ServiceNow Employee
ServiceNow Employee

It is technically possible with a global ui script. You would have to check to see what page you're on (global ui scripts run on every page load in SN), then if you're on the correct list, check the url for the correct parameter, then do some DOM manipulation to change the label for the table.



So it is technically possible, but I wouldn't recommend using a global ui script like that for something so specific. Assuming it's not a base table, you might consider relabeling it something that makes sense in both circumstances.


will_leingang
ServiceNow Employee
ServiceNow Employee

Global UI Scripts are always an option, but as Brad points out, with great power comes great responsibility.



Some alternatives:


  1. Simple: If you aren't already using a custom view you could show a simple label by appending this to the filter: sysparm_view=SOMENICELABEL

    and it will show up next to the table name like this:
    View Name.png
  2. Moderate: Create 2 actual views and then pass in the view name using sysparm_view, That will let you use a fancier string as the view name.
  3. Advanced: add a database view with a single table and different label, and then you can add that different link to the navigator module.


That label comes from either the default sys_ui_list_control for that table or the actual name of the table. It's also a translated field so if your instance uses multiple languages it would substitute that label if there was a translation for it.