Add Column name in My Request Widget

neethu4
Giga Expert

Hi All,

I want to modify My Request widget to add Created and Updated date  along with state and number column name.

How can i add column in the script and the date format need to change ad actual date instead of days ago.

Thanks,

Neethu

1 ACCEPTED SOLUTION

Hi Neethu,

I have done the required changes in the HTML part of my new clones widget and i have attached it in this reply.

You need to do little changes in the server script also for the cloned widget as follows:

Update server side script with the two lines after line number 153:
// new code sart
record.number=gr.getValue('number');
record.created_on=gr.getValue('sys_created_on');
// new code ends

 

After doing the changes you need to replace this widget with the My Requests widget in your portal page Requests.

as shown below:

find_real_file.png

 

Thanks,

Mohit Kaushik

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)

View solution in original post

13 REPLIES 13

Mohit Kaushik
Mega Sage
Mega Sage

Hi Neethu,

You need to click on instance option by doing ctr +right click on my request widget and from there you can select secondary fields whichever you want to use.

 

Please mark this answer correct if it resolved the query and mark it helpful too if it helped you at all.

 

Thanks,

Mohit Kaushik

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)

Below are the steps:

1. Ctrl+right click on my request widget.

find_real_file.png

 

2. Instance options open and select the secondary fields which you want to display.

find_real_file.png

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)

Hi Mohit,

The above mentioned insatnce options is disabled for this page.

And the page My requests which i mentioned is the below one.

 

Hi Neethu,

I thought that you are using simple list widget to display my requests.

 Now i saw that widget which is there is 'My Request' and in order to make changes you need to clone this widget and customize it with the below code.

After line 60 in HTML page

<div class="col-xs-3 padder-l-none padder-r-none number-column">
<div class="number">
<span> {{::item.number}}</span>
</div>
</div>
<div class="col-xs-3 padder-l-none padder-r-none created-column">
<div class="created">
<i class="fa fa-clock-o" aria-hidden="true" title="${Created}"></i>
<span>{{::item.created_on}}</span>
</div>
</div>

 

And in server script:

after line number 153

record.created_on = gr.getValue('sys_created_on');
record.number = gr.getValue('number');

 

After this it should work.

 

Please try this and let me know the response. Once you will clone and customize the widget you need to replace this widget in your page 'Requests'.

Let me know if you stuck at any step

 

Thanks,

Mohit Kaushik

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)