- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-17-2020 01:25 AM
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-18-2020 12:28 AM
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:
Thanks,
Mohit Kaushik
Mohit Kaushik
ServiceNow MVP (2023-2025)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-17-2020 01:54 AM
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
Mohit Kaushik
ServiceNow MVP (2023-2025)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-17-2020 02:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-17-2020 02:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-17-2020 03:17 AM
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
Mohit Kaushik
ServiceNow MVP (2023-2025)