Secondary fields are not displaying on Service Portal My Request page

Lavanya Damotha
Tera Contributor

Hi All,

 

As per users request, we are adding a OOB table under "My Request" page in Service Portal. So, I have created a record under "My Request Filter" with secondary fields but I was not able to find the field showing up on Portal. Where Number display value is true and it is extended from Task table.

LavanyaDamotha_0-1732532770556.pngLavanyaDamotha_1-1732532876227.png

Thank you

1 ACCEPTED SOLUTION

Pooja2998
Mega Sage

Hello @Lavanya Damotha ,

For that you need to Clone OOB "My Requests" Widget

After clone that widget follow these steps:

1. Update the HTML Template

In the cloned widget's HTML Template, update the code between lines 116 to 155 with the following:

 

<div role="table" ng-if="c.data.request.req_list.length > 0" class="table" aria-label="{{::data.messages.myRequestsTitle}}">
<div ng-show="::!data.is_associated_ticket_tab" role="rowgroup" class="column-headers">
<div role="row" class="list-group-item table-responsive">
<span role="columnheader" class="col-xs-3 padder-r-none padder-l-none">${Request}</span>
<span role="columnheader" class="col-xs-3 padder-r-none padder-l-none">${State}</span>
<span role="columnheader" class="col-xs-3 padder-r-none padder-l-none">${updated_capital}</span>
<span role="columnheader" class="col-xs-3 padder-r-none padder-l-none">${Priority}</span>
</div>
</div>
<ul role="rowgroup" class="padder-l-none padder-r-none">
<li role="row" class="list-group-item table-responsive" ng-repeat="item in c.data.request.req_list | limitTo: c.data.lastLimit track by item.sys_id" style="margin:0px" >
<div role="cell" class="col-xs-3 padder-l-none padder-r-none main-column">
<div class="primary-display">
<a href="?id={{::item.url.id}}&table={{::item.url.table}}&sys_id={{::item.url.sys_id}}" sn-focus="{{::item.highlight}}" aria-label="{{::item.display_field}} , {{::item.display_number}}"> {{::item.display_field}} </a>
</div>
<small class="text-muted">
<div ng-repeat="f in item.secondary_displays" class="secondary-display">
<span >{{::f.display_value}}</span>
</div>
</small>
</div>
<div role="cell" class="col-xs-3 padder-l-none padder-r-none state-column">
<div class="state">
<span> {{::item.state}}</span>
</div>
</div>
<div role="cell" class="col-xs-3 padder-l-none padder-r-none updated-column">
<div class="updated">
<i class="fa fa-clock-o" aria-hidden="true" title="${Updated}"></i>
<sn-time-ago timestamp="::item.updated_on"/>
</div>
</div>
<div role="cell" class="col-xs-3 padder-l-none padder-r-none state-priority">
<div class="priority">
<span> {{::item.priority}}</span>
</div>
</div>
</li>
</ul>
</div>

2. Update the Server Script

In the cloned widget's Server Script, add the following line at line 255:
record.priority = gr.getDisplayValue('priority');


Result:

Pooja2998_0-1732539333265.png

 

 

If you need more context or assistance, the reference file is attached for review.

If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Pooja.

 

View solution in original post

1 REPLY 1

Pooja2998
Mega Sage

Hello @Lavanya Damotha ,

For that you need to Clone OOB "My Requests" Widget

After clone that widget follow these steps:

1. Update the HTML Template

In the cloned widget's HTML Template, update the code between lines 116 to 155 with the following:

 

<div role="table" ng-if="c.data.request.req_list.length > 0" class="table" aria-label="{{::data.messages.myRequestsTitle}}">
<div ng-show="::!data.is_associated_ticket_tab" role="rowgroup" class="column-headers">
<div role="row" class="list-group-item table-responsive">
<span role="columnheader" class="col-xs-3 padder-r-none padder-l-none">${Request}</span>
<span role="columnheader" class="col-xs-3 padder-r-none padder-l-none">${State}</span>
<span role="columnheader" class="col-xs-3 padder-r-none padder-l-none">${updated_capital}</span>
<span role="columnheader" class="col-xs-3 padder-r-none padder-l-none">${Priority}</span>
</div>
</div>
<ul role="rowgroup" class="padder-l-none padder-r-none">
<li role="row" class="list-group-item table-responsive" ng-repeat="item in c.data.request.req_list | limitTo: c.data.lastLimit track by item.sys_id" style="margin:0px" >
<div role="cell" class="col-xs-3 padder-l-none padder-r-none main-column">
<div class="primary-display">
<a href="?id={{::item.url.id}}&table={{::item.url.table}}&sys_id={{::item.url.sys_id}}" sn-focus="{{::item.highlight}}" aria-label="{{::item.display_field}} , {{::item.display_number}}"> {{::item.display_field}} </a>
</div>
<small class="text-muted">
<div ng-repeat="f in item.secondary_displays" class="secondary-display">
<span >{{::f.display_value}}</span>
</div>
</small>
</div>
<div role="cell" class="col-xs-3 padder-l-none padder-r-none state-column">
<div class="state">
<span> {{::item.state}}</span>
</div>
</div>
<div role="cell" class="col-xs-3 padder-l-none padder-r-none updated-column">
<div class="updated">
<i class="fa fa-clock-o" aria-hidden="true" title="${Updated}"></i>
<sn-time-ago timestamp="::item.updated_on"/>
</div>
</div>
<div role="cell" class="col-xs-3 padder-l-none padder-r-none state-priority">
<div class="priority">
<span> {{::item.priority}}</span>
</div>
</div>
</li>
</ul>
</div>

2. Update the Server Script

In the cloned widget's Server Script, add the following line at line 255:
record.priority = gr.getDisplayValue('priority');


Result:

Pooja2998_0-1732539333265.png

 

 

If you need more context or assistance, the reference file is attached for review.

If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Pooja.