Data Table Widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2016 10:29 AM
Using the Data Table widget in the Service Portal that comes with Helsinki. Cloned it so that I could make it work for me. I added the table name (change_request) and added the fields I wanted to see. That however doesn't seem to be what that field means when I edit the widget. The widget defaults to 4 fields (Number,Category,Short Description and Approval). I did not select all of these and actually added a couple others I wanted to see but they don't show. I love the look of the table that it presents, but it's just not acting the way I expected. What am I missing about customizing/configuring a widget?
- Labels:
-
Performance Analytics
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2016 12:21 PM
Hey Stanley.
Yes, the fields option for Data Table widget doesn't seem to work. It doesn't populate the values of the 'Field' from the widget configuration page to the server script. I suggest you to use 'Data Table from Instance Definition' and then add the required fields. This worked for me. The 'fields' variable in 'widgetParams' passes the user field values to the while fetching 'Data Table' widget.
Regards,
Darshak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2017 11:49 AM
it looks like this is fixed in Helsinki Patch 8.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2017 02:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2017 07:41 AM
Hey folks,
There is a simple fix to this widget, rather than having static values set for the fields.
I noticed the mapping from the data object on the server script is different from the client script.
So on the client script I did the following:
At the beginning put the bolded statement after event names:
var eventNames = {
click: 'data_table.click',
setFilter: 'data_table.setFilter',
setKeywords: 'data_table.setKeywords'
};
//added code
var title = $scope.options.title;
var fields = $scope.options.field_list;
Then there is a point where it says "Make Widget Async." I changed the information a little to this:
// Makes Widget Async
title = $scope.options.title;
$scope.data = $scope.options;
$scope.data.fields = $scope.options.field_list;
$scope.loadingData = true;
$scope.server.update().then(function() {
$scope.loadingData = false;
$scope.data.title = title;
$scope.data.fields = fields;
initRecordWatcher($scope.data.table, $scope.data.filter);
});
This fixes the title issue, and the field list issue. Technically, i don't think you need to have the title = statement, but i left that there because currently everything works.
-Travis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2017 12:03 AM
Hello,
We have a requirement to display incident/RITM short description instead of survey description (asmt_assessment_instance) in the widget.
I have cloned the OOB data table widget and added the below code to fetch the actual incident short description. Issue is i am able to get the short description but unable to set it in the description field (refer above screenshot) :
var z = new GlideRecord(data.table);
z.addQuery("user", gs.getUserID());
z.addQuery("metric_type.active", true);
z.addQuery("metric_type.publish_state", "published");
z.addQuery("preview", false);
z.addEncodedQuery("stateINready,wip");
z.addEncodedQuery("sys_created_onONLast 30 days@javascript:gs.daysAgoStart(30)@javascript:gs.daysAgoEnd(0)");
//z.orderByDesc('sys_updated_on');
z.orderByDesc('state');
z.orderBy('due_date');
z.orderBy('sys_created_on');
z.setLimit(max);
z.query();
while (z.next()) {
if(z.trigger_table){
var tr = new GlideRecord(z.trigger_table);
if(tr.get(z.trigger_id)){
z.metric_type.description=tr.short_description;
//console.log("desc" +z.metric_type.description); } }
}
Any help is greatly appreciated !!!@Stanley Martin @niamccash
