Description
Overview
To hide the stage 'Request Approved' on the List view.
Hide a stage value on the ListView and Service Portal view
- For the List View: Under Column Render - Workflow-driven, the following code needs to be added to hide the stage.
var currentChoice = choices.getChoice(0).getValue();
if(currentChoice == "approved")
{
choices.removeChoice(0);
}
This is the expected output. Stage 'Request Approved' is removed from choice.
2. For Service Portal View: Go to https://<instance-name>.service-now.com/sp_ng_template.do?sys_id=c39057d0c73003002899a55e6c97633b
Add this code:
<div ng-if="data.choiceList.length > 0" class="requested-items-flex-container">
<button class="flex-item" role="button" ng-click="toggle($event, item)" aria-expanded="{{data.expand}}" aria-label="${collapse state of request}">
<img ng-if="!data.expand" src="images/filter_hide16.gifx" alt="${Expand state of request}"/>
<img ng-if="data.expand" src="images/filter_reveal16.gifx" alt="${Expand state of request}"/>
</button>
<div class="flex-item" ng-if="!data.expand">
<span ng-repeat="stage in data.choiceList.slice(1)">
<img id="stage.{{stage.value}}" title="{{stage.displayValue}}"
class="nopadding" src="images/heisenberg_icons/stage_icons/{{stage.image}}" alt="{{stage.displayValue}}" aria-hidden="true"/>
</span>
</div>
<div class="flex-item" ng-if="data.expand">
<div ng-repeat="stage in data.choiceList.slice(1)">
<div class="stage-on">
<img id="stage.{{stage.value}}" title="{{stage.displayValue}}"
class="nopadding" src="images/heisenberg_icons/stage_icons/{{stage.image}}" alt="{{stage.displayValue}}" aria-hidden="true"/>
<span aria-hidden="true">{{stage.displayValue}}</span>
</div>
</div>
</div>
</div>
As seen in this screenshot, the Request Approved stage is removed.