logo

NJP

How to make a responsive widget for the Service Portal

Import · Mar 14, 2018 · article

Question came up on the community and it isn't the first one. A member would like to have a "action button" that would appear or disappear on the page without needed to reload the page.

In this example I borrow an example of a action button from Serviceportal.io which has some really nice examples. A link to the specific page for it is at the description of the YouTube video. Then we add some code so depending if the state of the incident is "resolved" or not it will show different buttons with different behaviors. Either it's "Resolve incident" or "Reopen incident". And even if you have the page already open and someone else changes the state from the normal UI, the widget will change. All this is made possible through 1 (almost) line of code with the magic of recordwatch.

So sit back and enjoy the video.

//Göran

image

View original source

https://www.servicenow.com/community/developer-articles/how-to-make-a-responsive-widget-for-the-service-portal/ta-p/2329812