Hyperlink next to/ embedded to the checkbox field in Servicenow Workspace UI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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
