The CreatorCon Call for Content is officially open! Get started here.

Can we auto-refresh a widget in Service Portal ???

arnabbose
Tera Expert

Can we turn ON Auto-Refresh for a particular widget in Service Portal to auto-refresh every second?

As an example I was looking through below code but when I tried placing it in server script portion of my widget, I get an error that "angular" is not defined.

Can anyone please assist?

find_real_file.png

9 REPLIES 9

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

You got a OOB "cool clock" widget. I think that will give you exactly what you are after



//Göran


I am using this now....However whole page is refreshing after 15 secs...Cant just the widget refresh?



function($scope,$interval,$window) {


$interval(function(){


$window.location.reload();


},15000);


}


call $scope.server.update() from $interval function..so that it will call server script periodically.




(please mark helpful/like/correct if it helps)


rossipatel So basically it be like below?



  • Do I have to do anything in server script part?
  • So basically only my widget will refersh and not the page itself?


function($scope,$interval,$window) {


$interval(function(){


$scope.server.update();


},15000);


}


yupp..only widget will re-render...i would suggest you to go trough below documentation before jumpting into building things..



GitHub - service-portal/documentation: Here you will find unofficial documentation for the ServiceNo...




(please mark helpful/like/correct if it helps)