19 views

How to hide unchecked checkbox variables in "Options" of Approval Widget 



Description


As an approver, navigate to Service Portal to view requested approvals.

1. on Service Portal home page, click on "Approvals" in the header menu.

2. Click on any existing approval.

3. Under "Approval request for Request REQXXXX", toggle the "Options" arrow to open it.

Under here, some variables will display as "false". These are the checkbox variables which were not selected or checked at the time of submission of items.

The reason for this is that the checkbox variables have a default value of "false" in the backend code. As a result, when no value is selected, it will display the default value of false.

Some customers would like to hide these unchecked variables if they have a value of false.

Approval Options

Procedure


The following workaround displays how these variables can be hidden from the "Options":

  1. Navigate to Service Portal > Widgets.
  2. Name: Approval Record.
  3. Click on "Clone Widget" to create a copy of it.
  4. On the cloned widget, modify the "Body HTML Template" section as follows:

Find the line that says:

<div ng-repeat="variable in data.variables | filter:{visible_summary:true}" ng-if="variable_toggle">

Replace the next 2 lines with following:

From

<label>{{::variable.label}}</label>
<div>{{::variable.display_value}}</div>

To

<label ng-if="variable.display_value != 'false'">{{::variable.label}}</label> 
<div ng-if="variable.display_value != 'false'">{{::variable.display_value}}</div>  

Applicable Versions


All versions

Additional Information


 

Article Information

Last Updated:2018-07-19 12:40:59
Published:2018-05-03