Count Clicks of a Quick Link (Widget) on Employee Service Center

MichaelCreatura
Tera Guru

Hello,

Wondering if you can help, I am trying to implement the above. 

 

When a widget is clicked on the ESC, it counts the clicks. Specifically using the Quick Link widget (or a customised variation of the widget). I was following this article but it appears more complicated than it would suggest: Solved: Updating a record in a service portal widget - ServiceNow Community

Based on the above I have added this to the HTML:

MichaelCreatura_0-1709640534845.png

 

This to the server script:

MichaelCreatura_1-1709640534847.png

 

 

This to the client controller: 

MichaelCreatura_2-1709640534848.png

 

 

As you can see in the Server Script, I have created a new table and referenced it where required, but do I need to add anything else too it? 

 

MichaelCreatura_3-1709640534849.png

 

Any help appreciated! 

3 REPLIES 3

Sohithanjan G
Kilo Sage
Kilo Sage

@MichaelCreatura , where are you storing the clicks in your table

 

  1. Create a new field called count
  2. when you gliderecord your custom table add the count to your count field

 

gr.count +=1 
gr.update();

 

 

Let me know if you need anything 

Please mark as Accepted Solution if this solves your query and HIT Helpful if you find my answer helped you. This will help other community mates too..:)

James Chun
Kilo Patron

Hey @James Chun

I have looked at it, however there is nowhere that says how many clicks for a quick link record, it only shows visits to a topic page - is that correct? 

 

Thanks, 

Michael