Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Hyperlink next to/ embedded to the checkbox field in Servicenow Workspace UI

ArunaSukruM
ServiceNow Employee

Hello Dev community,

I'm trying to implement below requirement in servicenow workspace UI: 

Add a hyperlink next to checkbox field. Whenever this checkbox field is checked, link should disappear, if unchecked link should be present. 

UI Macros are not working in the workspace so kindly suggest how can we achieve this ?

5 REPLIES 5

Ankur Bawiskar
Tera Patron

@ArunaSukruM 

g_form.showFieldMsg() doesn't support links

2 approaches

1) use g_form.addInfoMessage() and show the link when checkbox unchecked and then hide it

OR

2) why not do this?

-> create a URL type field and store link in it

-> then write onChange client script on that checkbox and then show/hide that URL type field

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@ArunaSukruM 

Hope you are doing good.

Did my reply answer your question?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Hello, thanks a lot for your response.

  • g_form.addInfoMessage()  gives hyperlink in the info message but it should be next or below the checkbox so cannot implement this.
  • URL type field we need to enter in the hyperlink. Even if we give default value it's not like hyperlink but it's like a free text field. 
  • We had divided form into multiple form sections and inserted text link component in UI Builder in between each form section. 

Tanushree Maiti
Giga Sage

Hi @ArunaSukruM ,

 

You can do following code/configuration to achieve your requirement

1.When checkbox is loaded with form loading , using Onload client script , you can show hyper link

function onLoad() {

g_form.addInfoMessage("Please <a href = '/incident_list.do'>ClickOn checckbox</a>");

}

2. Using UI policy (based on checking whether checkbox is checked) , hide/display that checkbox

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: