Skip to main content

Posts

Showing posts from March, 2025

ServiceNow Create Clickable URL Link in Portal Page (Catalog Item) - internal link or external link?

  ServiceNow Create Clickable Link in Portal Page (Catalog Item) To create a clickable link within a ServiceNow portal catalog item, use a " Rich Text Label " variable type, allowing you to embed HTML and create a hyperlink using the  <a href>  tag for an external link , if you find that by default it is appending the instance url as a prefix to the external url resulting in a broken link, then modify the HTML  of the Rich Text Label (via the editor) and change it as follows: <p><span style="font-size: 12pt;"><a href= https://www.google.com   target="_blank" rel="noopener noreferrer nofollow" >Information page</a></span></p>

Compare a script to prod without actually going on prod

 Compare a script to prod without actually going on prod If you know the update set, you can go to the script include> versions tab> right click the update set and select 'compare to current'

ServiceNow add 24hrs to a date

ServiceNow add 1 day to a date  var gdt = new GlideDateTime (); gdt.addDaysLocalTime( 1 ); gs.info(gdt.getDisplayValue()); gs.info(gdt.getLocalDate()); ServiceNow add 24hrs to a date Date/Time: var gdt = new GlideDateTime (); //--for scoped app, use new GlideDateTime (; gs.info( 'GDT original milliseconds=' +gdt.getNumericValue()); gdt.add( 86400000 ); gs.info( 'GDT new milliseconds=' +gdt.getNumericValue()); gs.info( 'GDT=' +gdt); alternative var gdt = new GlideDateTime("2011-08-31 08:00:00"); var gtime1 = new GlideTime(); gtime1.setValue("00:00:20"); gdt.add(gtime1); var gtime2 = gdt.getTime(); var gdt = new GlideDateTime("2011-08-31 08:00:00"); gdt.addDaysLocalTime(-1); gs.info(gdt.getLocalDate()); Date: var gdt = new GlideDateTime (); gs.info( 'GDT original milliseconds=' +gdt.getNumericValue()); gdt.add( 86400000 ); gs.info( 'GDT new milliseconds=' +gdt.getNumericValue()); gs.info( 'GDT=' +gdt); v...