How to control what fields show (and in what order) on Approval Record widget?

John Diaz
Kilo Guru

How can I control what fields show, and in what order on the Approval Record widget in the Service Portal? Some of the fields showing are variables from the Record Producer that don't map to the record itself... I created an Approver form view, but that didn't do anything either.

On a side note - anyone know why the sys_id is showing for Location? That's a reference field to the 'cmn_location' table, and Name is enabled as the Display field on that table.

 

find_real_file.png

1 ACCEPTED SOLUTION

John Diaz
Kilo Guru

For reference:

What variables show:

This is handled by the 'Visible on Summaries' box in the Availability tab of the variable itself.

 

Why sys_id was showing:

This was because I was building a list for a Select Box variable type rather than using a Dynamic Reference Qualifier on a Reference variable type. As soon as I switched to Reference, the Display Value showed.

 

I was not able to figure out how to control the orderBy on the variables though.

View solution in original post

2 REPLIES 2

Bryan Tay3
Mega Guru

hi John, 

I think you will have to go into the code level in order to customize what you need as the OOTB 'Approval Record' widget does not have options for view, order etc.

Just clone the "Approval Record" widget, name it 'Approval Record for XXX' (just for this type of record) so that you can edit it, look for 'item.variables' (Server Script) and manipulate it by hiding any variables that you don't like to show.

As for the order of the field, you can change the order in the HTML Template for 'item.variables':

<div ng-repeat="variable in item.variables | filter:{visible_summary:true}" class="m-b-xs" ng-if="variable_toggle">
<label>{{::variable.label}}</label>
<div>{{::variable.display_value}}</div>
</div>

Angular Reference:

https://docs.angularjs.org/api/ng/filter/orderBy

 

Hope this helps.

 

John Diaz
Kilo Guru

For reference:

What variables show:

This is handled by the 'Visible on Summaries' box in the Availability tab of the variable itself.

 

Why sys_id was showing:

This was because I was building a list for a Select Box variable type rather than using a Dynamic Reference Qualifier on a Reference variable type. As soon as I switched to Reference, the Display Value showed.

 

I was not able to figure out how to control the orderBy on the variables though.