<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: hyper link in showFieldMsg on load client script in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/hyper-link-in-showfieldmsg-on-load-client-script/m-p/3559727#M1257929</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/406401"&gt;@Alon Grod&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here it look like :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Aditya_hublikar_0-1781599164459.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/519966i2A71488B6D9E3EBB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Aditya_hublikar_0-1781599164459.png" alt="Aditya_hublikar_0-1781599164459.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try this code snippet :&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function onLoad() {
    var fieldName = 'u_incident'; 
    var placeholder = "##placeholder##";
    var url = "https://google.com"; /
    
   
    g_form.showFieldMsg(fieldName, placeholder, 'info', false);
    
 
    try {
        var elements = document.getElementsByClassName("fieldmsg notification notification-info");
        if(elements.length &amp;gt; 0) {
            var str = elements[0].innerHTML;
            str = str.substring(0, str.indexOf(placeholder));
            elements[0].innerHTML = str + 'Please &amp;lt;a href="' + url + '" target="_blank"&amp;gt;click here&amp;lt;/a&amp;gt; for more information.';
        }
    } catch(e) {
        // Fallback or error handling
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note : uncheck isolated script&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this helps you then mark it as helpful and accept as solution.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jun 2026 08:40:33 GMT</pubDate>
    <dc:creator>Aditya_hublikar</dc:creator>
    <dc:date>2026-06-16T08:40:33Z</dc:date>
    <item>
      <title>hyper link in showFieldMsg on load client script</title>
      <link>https://www.servicenow.com/community/developer-forum/hyper-link-in-showfieldmsg-on-load-client-script/m-p/3559663#M1257925</link>
      <description>&lt;P&gt;How can I add hyper link using onLoad client script and&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;g_form.showFieldMsg&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;(for example the user will see 'click here' and it will redirect to google)&lt;BR /&gt;&lt;BR /&gt;My field name is:&amp;nbsp;&lt;SPAN&gt;u_priferia&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;table name:&amp;nbsp;sn_slm_case&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2026 06:44:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/hyper-link-in-showfieldmsg-on-load-client-script/m-p/3559663#M1257925</guid>
      <dc:creator>Alon Grod</dc:creator>
      <dc:date>2026-06-16T06:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: hyper link in showFieldMsg on load client script</title>
      <link>https://www.servicenow.com/community/developer-forum/hyper-link-in-showfieldmsg-on-load-client-script/m-p/3559672#M1257926</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/406401"&gt;@Alon Grod&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By default, ServiceNow's&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;g_form.showFieldMsg&lt;/STRONG&gt;&lt;/SPAN&gt; treats text as &lt;STRONG&gt;plain string and escapes HTML tags.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OOB it is not supported.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You need to write an &lt;STRONG&gt;onLoad Client Script&lt;/STRONG&gt; that pushes a placeholder message and dynamically updates the &lt;STRONG&gt;DOM&lt;/STRONG&gt; element&amp;nbsp; ( DOM is not recommended).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Refer&amp;nbsp; for DOM onload script:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://www.servicenow.com/community/itsm-forum/need-help-in-adding-a-link-in-string-type-field/td-p/640180" target="_blank" rel="noopener"&gt;https://www.servicenow.com/community/itsm-forum/need-help-in-adding-a-link-in-string-type-field/td-p/640180&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2026 07:02:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/hyper-link-in-showfieldmsg-on-load-client-script/m-p/3559672#M1257926</guid>
      <dc:creator>Tanushree Maiti</dc:creator>
      <dc:date>2026-06-16T07:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: hyper link in showFieldMsg on load client script</title>
      <link>https://www.servicenow.com/community/developer-forum/hyper-link-in-showfieldmsg-on-load-client-script/m-p/3559727#M1257929</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/406401"&gt;@Alon Grod&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here it look like :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Aditya_hublikar_0-1781599164459.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/519966i2A71488B6D9E3EBB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Aditya_hublikar_0-1781599164459.png" alt="Aditya_hublikar_0-1781599164459.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try this code snippet :&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function onLoad() {
    var fieldName = 'u_incident'; 
    var placeholder = "##placeholder##";
    var url = "https://google.com"; /
    
   
    g_form.showFieldMsg(fieldName, placeholder, 'info', false);
    
 
    try {
        var elements = document.getElementsByClassName("fieldmsg notification notification-info");
        if(elements.length &amp;gt; 0) {
            var str = elements[0].innerHTML;
            str = str.substring(0, str.indexOf(placeholder));
            elements[0].innerHTML = str + 'Please &amp;lt;a href="' + url + '" target="_blank"&amp;gt;click here&amp;lt;/a&amp;gt; for more information.';
        }
    } catch(e) {
        // Fallback or error handling
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note : uncheck isolated script&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this helps you then mark it as helpful and accept as solution.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2026 08:40:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/hyper-link-in-showfieldmsg-on-load-client-script/m-p/3559727#M1257929</guid>
      <dc:creator>Aditya_hublikar</dc:creator>
      <dc:date>2026-06-16T08:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: hyper link in showFieldMsg on load client script</title>
      <link>https://www.servicenow.com/community/developer-forum/hyper-link-in-showfieldmsg-on-load-client-script/m-p/3559733#M1257931</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/406401"&gt;@Alon Grod&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;g_form.showFieldMsg doesn't support HTML so your requirement is not possible&lt;/P&gt;
&lt;P&gt;You can inform your customer about this platform limitation and instead show infoMessage on form&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note: There are approaches to achieve this with DOM manipulation but it's not recommended to use&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; If my response helped, please mark it as correct &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; and close the thread &lt;span class="lia-unicode-emoji" title=":locked:"&gt;🔒&lt;/span&gt;— this helps future readers find the solution faster! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2026 08:43:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/hyper-link-in-showfieldmsg-on-load-client-script/m-p/3559733#M1257931</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2026-06-16T08:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: hyper link in showFieldMsg on load client script</title>
      <link>https://www.servicenow.com/community/developer-forum/hyper-link-in-showfieldmsg-on-load-client-script/m-p/3559839#M1257953</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/406401"&gt;@Alon Grod&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can achieve this using DOM manipulation from an onLoad Client Script.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;function onLoad() {
    g_form.showFieldMsg('u_priferia', 'Click here', 'info');
    setTimeout(function() {
        var msgs = document.querySelectorAll('.fieldmsg');
        msgs.forEach(function(msg) {
            if (msg.innerText.indexOf('Click here') &amp;gt; -1) {
                msg.innerHTML = '&amp;lt;a href="https://www.google.com" target="_blank"&amp;gt;Click here&amp;lt;/a&amp;gt;';
            }

        });

    }, 1000);
}
&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Important: Make sure Isolate Script is unchecked on the Client Script, otherwise DOM APIs such as &lt;/SPAN&gt;&lt;SPAN&gt;document.querySelectorAll()&lt;/SPAN&gt;&lt;SPAN&gt; will not be accessible.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vaishali231_0-1781607588208.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/519991i385D9349025E7FD3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vaishali231_0-1781607588208.png" alt="vaishali231_0-1781607588208.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;&lt;SPAN&gt;: Direct DOM manipulation is generally not recommended in ServiceNow because DOM elements and CSS classes can change across releases, which may cause scripts to break after upgrades. Where possible, consider supported alternatives such as UI Macros, Formatters, HTML fields, or Workspace components depending on your use case.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;***********************************************************************************************************************************&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this response helps, please mark it as Accept as Solution and Helpful.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Doing so helps others in the community and encourages me to keep contributing.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regards&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Vaishali Singh&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Servicenow Developer &lt;/STRONG&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;Linkedin - &lt;/STRONG&gt;&lt;A href="https://www.linkedin.com/in/vaishali-singh-2273361bb" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;https://www.linkedin.com/in/vaishali-singh-2273361bb&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2026 11:00:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/hyper-link-in-showfieldmsg-on-load-client-script/m-p/3559839#M1257953</guid>
      <dc:creator>vaishali231</dc:creator>
      <dc:date>2026-06-16T11:00:44Z</dc:date>
    </item>
  </channel>
</rss>

