Service Portal Data Table Widget Customization
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 09:16 AM
I've been working on a space-saving customization to the "Data Table from Instance Definition" widget.
Basically, I want users to be able to click a button and be able to choose which list they see, as well as be able to click an item on the list and have it load on the form widget on the same page.
I have that part working, using $broadcast to send events and pass information between the various widgets, see below:
What I haven't been able to figure out is how to get the Filter to respond. I've been through all the nested widgets, replaced them with custom ones, and passed every variable i can think of to every place i can think of, and no luck. The best I can figure, the filter widget (which is another embedded widget) isn't being reset when everything else is. Either that or theirs some piece of data I'm not passing.
Anyone have any ideas?
I really wish I could tag people, because I'd love to ask Nathan Firth or Chuck Tomasi about this one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 10:02 AM
We have a similar widget that we use, it's a configurable widget that takes properties to define the tabs and filters, and then embeds the data table to render the list. You should not have to clone any of the OOB widgets to accomplish this.
Try something like this... in your controller:
var options = {
filter: "opened_byDYNAMIC90d1921e5f510100a9ad2572f2b477fe^active=true",
page: "ticket",
table: "incident",
view: "sp"
};
spUtil.get('widget-data-table', options).then(function(response) {
$scope.widget = response;
});
and then in the HTML embed it as usual:
<sp-widget widget="widget"></sp-widget>
I haven't tested this, but it should work.
This is what our widget looks like. It has options for tables, filters, columns, etc. so that we can use it against any set of tables.
Hope that helps,
-----------------
Nathan Firth
Founder and ServiceNow Architect
NewRocket, Inc.
nathan.firth@newrocket.com
http://serviceportal.io
http://newrocket.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 11:56 AM
Nathan,
Thanks! That part is working. It's the embedded filter widget that isn't. When the page loads, the list is drawn from the incident table, and the fields to choose in the filter load fine:
But when I switch it to the Requested Item table, it won't load anything but "keywords":
I think I've found the code responsible in the Server Script for the data table widget:
I have set the values for data.table, and data.filter, but I can't seem to get the widget to actually use them. I've dumped $scope to console both when it's working and not, and compared the structure of the relevant parts, and they seem identical (except for table names, of course) so I'm not sure what I'm doing wrong.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2020 05:32 AM
Hi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2020 03:34 AM
Hi