Portal Popular Items Modification

Naveen87
Tera Guru

Hey Developers,

 

I want to Modify Popular Item Widget.

 

Ex:- From past 1 year (A & B) items are used often & visible under Popular Items.

I wanna know the period (1 year , 6 months, etc..). How does it gets calculated & visible under the Widget.

Naveen87_0-1670493496035.png

 

 

I also want to reduce the time span under the widget.(Once I know the OOB time span of calculation).

Ex:- If OOB is calculating the Items used in 1year then I want to reduce it to 6 or 3 months. Because it takes longer time to Load.

 

Can you please help me understand how this widget works & how can I achieve my task.

 

 

Thank you.

1 ACCEPTED SOLUTION

@Naveen87 They are showing the only 9 or any limit added in the instance options. Please data.limit variable.

 

jaheerhattiwale_0-1670509093908.png

 

Out of all the RITMs they are taking 9 or any number added in instance options. (Checking the data,limit condition in while loop)

 

If you want it to be within 6 months then add an extra query like below

jaheerhattiwale_1-1670509380995.png

 

 

Please mark as correct answer if this solves your issue.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

View solution in original post

7 REPLIES 7

jaheerhattiwale
Mega Sage
Mega Sage

@Naveen87 The widget name is "SC Popular Items" its used in "sc_home" page

jaheerhattiwale_0-1670495729720.png

 

Open the widget and check server side code

jaheerhattiwale_1-1670495772618.png

 

 

If you think you need to change it then clone the widget do the changes and add it to the page you want

 

 

Please mark as correct answer if this solves your issue.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

@jaheerhattiwale ,

I could not find any time limit for this.

I can see it shows all the RITM's raised since the Item was build.

This takes a lot of time to load.

 

Can we add some encodedquery?

After line No.6

Naveen87_0-1670508443394.png

For last 12 months.

Naveen87_1-1670508452375.png

 

Is 6 months query right?

Naveen87_2-1670508550836.png

 

@Naveen87 They are showing the only 9 or any limit added in the instance options. Please data.limit variable.

 

jaheerhattiwale_0-1670509093908.png

 

Out of all the RITMs they are taking 9 or any number added in instance options. (Checking the data,limit condition in while loop)

 

If you want it to be within 6 months then add an extra query like below

jaheerhattiwale_1-1670509380995.png

 

 

Please mark as correct answer if this solves your issue.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

@jaheerhattiwale ,

I have tried 6 , 3 last month now.

Before add this condition time was 26 sec.

After adding it's reduced to 14-15 sec. For all 6 , 3 & last time is same.

Naveen87_0-1671179005326.png

 

What else can be done here to reduce the response time.

Can it be get more quicker?

Any suggestions?