Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Mike S1
Tera Contributor

Earlier I looked at the initial setup of Link Generator for Buttons. The other half of Link Generator are those that are rendered as a Generated Link. The idea behind this is you can define a link through the setup process that you can call from multiple places in the platform. It does this through the use of an API call that handles the switching of the link you clicked to the link you want to go to.

 

First is the setup. The first half of the setup process is the same as the setup for a button, defining the base URL that would be set in the final link.

 

MikeS1_0-1761154983401.png

 

Now, the second part of the process involves setting a script the same way as you would for a button, but now selecting a Link type of Generated link. Making that selection opens the Generated URL field just below the Script section. This isn't editable, but you'll want to copy it to use it elsewhere in the system.

 

MikeS1_1-1761154983401.png

 

That Generated URL link points to an API that sits in Scripted REST Service under GeneratedLink. Not that you should ever change this, but in case you need to debug or see what options are available, here's where it is located.

 

MikeS1_2-1761154983402.png

 

To go to the Generated URL link that you copied, you would append it to the base URL of your instance. For a PDI of https://dev12345.service-now.com plus the API script to call the link defined /api/now/generatedlink/getURL?name=google_google to form the whole link. Just pasting that into a browser will test your link out.

 

Now, most if the time if you're using this in the portal, you'll only need the API portion of the URL as the instance half is implied when setting up things to use Link Generator.