How to change the label of a column in the "Data Table from Instance Definition" widget on the Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2020 12:21 PM
Hello,
I have a "Data Table from Instance Definition" widget on the service portal. I am using the table alm_hardware and selected a few columns to display.
Is it possible to change the label for a column on one widget. We want to change the label on the Widget not on the table definition.
Thank You
Surendra
- Labels:
-
Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2020 10:09 AM
Hi Spark106,
You can simply do that by following below steps.
Step1. Find the label HTML
Step2. In your widget client script, catch and change it.
// Change Field label
// Timeout for data to be loaded
setTimeout(function(){
document.querySelector('div[aria-label="Sort by Short description"]').innerText = "Long Description"
},3000);
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Cuong Phan
DXC Consultant.
Cuong Phan
ServiceNow Technical Lead