Add additional columns to the My_Requests widget

Steven Watts2
Tera Guru

Hi,

 

I'm trying to add the assigned to value to the My_Requests widget. 

 

StevenWatts2_0-1715330319564.png

I've added the following:

HTML (Lines 150 - 154)

<div role="cell" class="col-xs-3 padder-l-none padder-r-none assigned-column">
            <div class="assigned">
              <span> {{::item.assigned_to}}</span>
            </div>
</div>

Server Script (Lines 249 - 252)

record.secondary_displays = getField(gr, 'short_description');
record.assigned_to = gr.getDisplayValue('assigned_to');   <-- Here
record.updated_on = gr.getValue('sys_updated_on');
record.state = gr.getDisplayValue('state');

 Has anyone else done something similar and knows what i've missed?

 

5 REPLIES 5

swathisarang98
Giga Sage
Giga Sage

Hi @Steven Watts2 ,

 

You can follow the below steps to add column,

https://www.servicenow.com/community/developer-forum/add-column-name-in-my-request-widget/m-p/157362... 

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

@Steven Watts2 , i tried this in my pdi along with the above mentioned solution you need few more lines of code to show assigned to column and align the value,

 

After the below line add one more line 

<span role="columnheader" class="col-xs-3 padder-r-none padder-l-none">${updated_capital}</span> OOTB Line (line no 123) 

 <span role="columnheader" class="col-xs-3 padder-r-none padder-l-none">${Created}</span> 

 

swathisarang98_1-1715349801311.png

 

 

and change bootstrap to class="col-xs-3 for all 4 span( line num,120 to 123 and 128 also )

 

Result:

I tried for Created On

swathisarang98_2-1715349872734.png

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

 

 

 

Thanks @swathisarang98 

 

I will try this shortly and get back to you.

Did you solve this?