How to add a hyperlink to a select box variable name

aimughal
Tera Contributor

So far I can only add the hyperlinked word in the help text, but the requirement is to have the hyperlink in the actual question/variable, which is a select box. 

 

6 REPLIES 6

Unique45
Mega Sage

Hello @aimughal ,

Using UI macro you can achieve this.

1) Navigate to All > System UI > UI macros > new .

2) All following code in the UI macros (just an example. modify code as per your requirement).

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
	<label class="col-xs-12 control-label"><a href="https://www.servicenow.com/community/virtual-agent-forum/how-to-add-a-hyperlink-to-a-select-box-variable-name/td-p/2968405">Category</a></label>
	<div class="col-xs-6">
	<select class="form-control cat_item_option">   
		  <option value="software">Software</option>
		  <option value="hardware">Hardware</option>
    </select>
	</div>
</j:jelly>

Unique45_1-1718876601199.png

 

3) Create variable. Choose type Custom.

Unique45_2-1718876935708.png

4) In Type Specification tab, in macro field choose created macro.

Unique45_3-1718877064999.png

 

It's looks like this in the form:

Unique45_0-1718876553403.png

 

 

 

Please mark correct/helpful if this helps you!

@Unique45 I used your code, and it works fine at the catalog form level when I click on 'Try It,' but at the portal level, the variable is not showing.

mrreddy534
Tera Contributor

Hi @Unique45 , is it possible to make the choices of a multiple-choice variable into hyperlinks, or at least make the variable itself a hyperlink?

Hello @mrreddy534 ,

In my opinion, it is not possible to make the choices of a multiple-choice variable into hyperlinks, but you can make the variable label a hyperlink

 

Please mark correct/helpful if this helps you!